-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Fix materialization with ttl=0 bug (#2666)
* Fix materialization with ttl=0 bug Signed-off-by: Felix Wang <[email protected]> * Add TODO Signed-off-by: Felix Wang <[email protected]>
- Loading branch information
1 parent
44ca9f5
commit ab78702
Showing
3 changed files
with
74 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
48 changes: 48 additions & 0 deletions
48
sdk/python/tests/example_repos/example_feature_repo_with_ttl_0.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from datetime import timedelta | ||
|
||
from feast import Entity, FeatureView, Field, FileSource, ValueType | ||
from feast.types import Float32, Int32, Int64 | ||
|
||
driver_hourly_stats = FileSource( | ||
path="%PARQUET_PATH%", # placeholder to be replaced by the test | ||
timestamp_field="event_timestamp", | ||
created_timestamp_column="created", | ||
) | ||
|
||
driver = Entity(name="driver_id", value_type=ValueType.INT64, description="driver id") | ||
|
||
|
||
driver_hourly_stats_view = FeatureView( | ||
name="driver_hourly_stats", | ||
entities=[driver], | ||
ttl=timedelta(days=0), | ||
schema=[ | ||
Field(name="conv_rate", dtype=Float32), | ||
Field(name="acc_rate", dtype=Float32), | ||
Field(name="avg_daily_trips", dtype=Int64), | ||
], | ||
online=True, | ||
source=driver_hourly_stats, | ||
tags={}, | ||
) | ||
|
||
|
||
global_daily_stats = FileSource( | ||
path="%PARQUET_PATH_GLOBAL%", # placeholder to be replaced by the test | ||
timestamp_field="event_timestamp", | ||
created_timestamp_column="created", | ||
) | ||
|
||
|
||
global_stats_feature_view = FeatureView( | ||
name="global_daily_stats", | ||
entities=[], | ||
ttl=timedelta(days=0), | ||
schema=[ | ||
Field(name="num_rides", dtype=Int32), | ||
Field(name="avg_ride_length", dtype=Float32), | ||
], | ||
online=True, | ||
source=global_daily_stats, | ||
tags={}, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters