-
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: Register BatchFeatureView in feature repos correctly (#3092)
* fix: Registry BatchFeatureView in feature repos correctly Signed-off-by: Achal Shah <[email protected]> * tests Signed-off-by: Achal Shah <[email protected]> Signed-off-by: Achal Shah <[email protected]>
- Loading branch information
Showing
4 changed files
with
77 additions
and
2 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
52 changes: 52 additions & 0 deletions
52
sdk/python/tests/example_repos/example_feature_repo_with_bfvs.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 BatchFeatureView, Entity, Field, FileSource | ||
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", | ||
description="driver id", | ||
) | ||
|
||
|
||
driver_hourly_stats_view = BatchFeatureView( | ||
name="driver_hourly_stats", | ||
entities=[driver], | ||
ttl=timedelta(days=1), | ||
schema=[ | ||
Field(name="conv_rate", dtype=Float32), | ||
Field(name="acc_rate", dtype=Float32), | ||
Field(name="avg_daily_trips", dtype=Int64), | ||
Field(name="driver_id", dtype=Int32), | ||
], | ||
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 = BatchFeatureView( | ||
name="global_daily_stats", | ||
entities=None, | ||
ttl=timedelta(days=1), | ||
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
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