tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store¶
Example Airflow DAG for Google Vertex AI Feature Store operations.
Attributes¶
Module Contents¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.DAG_ID = 'vertex_ai_feature_store_dag'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.BQ_DATASET_ID = 'bq_ds_featurestore_demo'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.BQ_VIEW_ID = 'product_features_view'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.BQ_VIEW_FQN = 'Uninferable.bq_ds_featurestore_demo.product_features_view'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.FEATURE_ONLINE_STORE_ID = 'my_feature_online_store_unique_Uninferable'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.FEATURE_VIEW_ID = 'feature_view_product'[source]¶
- tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.FEATURE_EXTRACT_QUERY = Multiline-String[source]¶
Show Value
""" WITH product_order_agg AS ( SELECT cast(product_id as string) as entity_id, countif(status in ("Shipped", "Complete")) as good_order_count, countif(status in ("Returned", "Cancelled")) as bad_order_count FROM `bigquery-public-data.thelook_ecommerce.order_items` WHERE timestamp_trunc(created_at, day) >= timestamp_trunc(timestamp_sub(CURRENT_TIMESTAMP(), interval 30 day), day) and timestamp_trunc(created_at, day) < timestamp_trunc(CURRENT_TIMESTAMP(), day) group by 1 order by entity_id), product_basic AS ( SELECT cast(id as string) AS entity_id, lower(name) as name, lower(category) as category, lower(brand) as brand, cost, retail_price FROM bigquery-public-data.thelook_ecommerce.products) SELECT *, current_timestamp() as feature_timestamp FROM product_basic LEFT OUTER JOIN product_order_agg USING (entity_id) """