Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change GCP template names to match local template #1470

Merged
merged 1 commit into from
Apr 15, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions sdk/python/feast/templates/gcp/driver_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
woop marked this conversation as resolved.
Show resolved Hide resolved
# 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
Expand All @@ -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",
Expand All @@ -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.
Expand Down
7 changes: 4 additions & 3 deletions sdk/python/feast/templates/gcp/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand All @@ -31,7 +31,7 @@ def main():
periods=3,
)
],
"driver_id": [5001, 5002, 5003],
"driver_id": [1001, 1002, 1003],
}
)

Expand All @@ -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()
Expand Down