-
Notifications
You must be signed in to change notification settings - Fork 998
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Add feature repo for version 0.19 (#2659)
* Use `join_keys` instead of `join_key` when instantiating entity Signed-off-by: Felix Wang <[email protected]> * Switch from `batch_source` to `source` Signed-off-by: Felix Wang <[email protected]> * Clean up test Signed-off-by: Felix Wang <[email protected]> * Add example feature repo for version 0.19 Signed-off-by: Felix Wang <[email protected]> * Add test for 0.19 example feature repo Signed-off-by: Felix Wang <[email protected]>
- Loading branch information
1 parent
bb72b7c
commit 6589f15
Showing
5 changed files
with
106 additions
and
41 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
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
52 changes: 52 additions & 0 deletions
52
sdk/python/tests/example_repos/example_feature_repo_version_0_19.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,52 @@ | ||
from datetime import timedelta | ||
|
||
from feast import Entity, Feature, FeatureView, FileSource, ValueType | ||
|
||
driver_hourly_stats = FileSource( | ||
path="%PARQUET_PATH%", # placeholder to be replaced by the test | ||
event_timestamp_column="event_timestamp", # Changed to `timestamp_field` in 0.20 | ||
created_timestamp_column="created", | ||
) | ||
|
||
driver = Entity( | ||
name="driver_id", | ||
value_type=ValueType.INT64, | ||
description="driver id", | ||
join_key="driver_id", # Changed to `join_keys` in 0.20 | ||
) | ||
|
||
|
||
driver_hourly_stats_view = FeatureView( | ||
name="driver_hourly_stats", | ||
entities=["driver_id"], | ||
ttl=timedelta(days=1), | ||
features=[ # Changed to `schema` in 0.20 | ||
Feature(name="conv_rate", dtype=ValueType.FLOAT), # Changed to `Field` in 0.20 | ||
Feature(name="acc_rate", dtype=ValueType.FLOAT), | ||
Feature(name="avg_daily_trips", dtype=ValueType.INT64), | ||
], | ||
online=True, | ||
batch_source=driver_hourly_stats, # Changed to `source` in 0.20 | ||
tags={}, | ||
) | ||
|
||
|
||
global_daily_stats = FileSource( | ||
path="%PARQUET_PATH_GLOBAL%", # placeholder to be replaced by the test | ||
event_timestamp_column="event_timestamp", # Changed to `timestamp_field` in 0.20 | ||
created_timestamp_column="created", | ||
) | ||
|
||
|
||
global_stats_feature_view = FeatureView( | ||
name="global_daily_stats", | ||
entities=[], | ||
ttl=timedelta(days=1), | ||
features=[ # Changed to `schema` in 0.20 | ||
Feature(name="num_rides", dtype=ValueType.INT32), # Changed to `Field` in 0.20 | ||
Feature(name="avg_ride_length", dtype=ValueType.FLOAT), | ||
], | ||
online=True, | ||
batch_source=global_daily_stats, # Changed to `source` in 0.20 | ||
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
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