diff --git a/sdk/python/feast/templates/gcp/driver_repo.py b/sdk/python/feast/templates/gcp/driver_repo.py index 03ee6e1272..b36758046d 100644 --- a/sdk/python/feast/templates/gcp/driver_repo.py +++ b/sdk/python/feast/templates/gcp/driver_repo.py @@ -7,7 +7,7 @@ # construction of feature vectors driver = Entity( # Name of the entity. Must be unique within a project - name="driver", + name="driver_id", # The join key of an entity describes the storage level field/column on which # features can be looked up. The join key is also used to join feature # tables/views when building feature vectors @@ -20,7 +20,7 @@ # datasets or materializing features into an online store. driver_stats_source = BigQuerySource( # The BigQuery table where features can be found - table_ref="feast-oss.demo_data.driver_stats", + table_ref="feast-oss.demo_data.driver_hourly_stats", # The event timestamp is used for point-in-time joins and for ensuring only # features within the TTL are returned event_timestamp_column="datetime", @@ -34,11 +34,11 @@ driver_stats_fv = FeatureView( # The unique name of this feature view. Two feature views in a single # project cannot have the same name - name="driver_stats", + name="driver_hourly_stats", # The list of entities specifies the keys required for joining or looking # up features from this feature view. The reference provided in this field # correspond to the name of a defined entity (or entities) - entities=["driver"], + entities=["driver_id"], # The timedelta is the maximum age that each feature value may have # relative to its lookup time. For historical features (used in training), # TTL is relative to each timestamp provided in the entity dataframe. diff --git a/sdk/python/feast/templates/gcp/test.py b/sdk/python/feast/templates/gcp/test.py index 00bb4ae63c..aee8950077 100644 --- a/sdk/python/feast/templates/gcp/test.py +++ b/sdk/python/feast/templates/gcp/test.py @@ -18,7 +18,7 @@ def main(): fs.apply([driver, driver_stats_fv]) # Select features - feature_refs = ["driver_stats:conv_rate", "driver_stats:acc_rate"] + feature_refs = ["driver_hourly_stats:conv_rate", "driver_hourly_stats:acc_rate"] # Create an entity dataframe. This is the dataframe that will be enriched with historical features entity_df = pd.DataFrame( @@ -31,7 +31,7 @@ def main(): periods=3, ) ], - "driver_id": [5001, 5002, 5003], + "driver_id": [1001, 1002, 1003], } ) @@ -54,7 +54,8 @@ def main(): # Retrieve features from the online store (Firestore) online_features = fs.get_online_features( - feature_refs=feature_refs, entity_rows=[{"driver": 5001}, {"driver": 5002}] + feature_refs=feature_refs, + entity_rows=[{"driver_id": 1001}, {"driver_id": 1002}], ).to_dict() print()