Airflow Summit 2025 is coming October 07-09. Register now to secure your spot!

tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store

Example Airflow DAG for Google Vertex AI Feature Store operations.

Attributes

PROJECT_ID

ENV_ID

DAG_ID

REGION

BQ_LOCATION

BQ_DATASET_ID

BQ_VIEW_ID

BQ_VIEW_FQN

FEATURE_ONLINE_STORE_ID

FEATURE_VIEW_ID

FEATURE_VIEW_DATA_KEY

FEATURE_EXTRACT_QUERY

create_bq_dataset

test_run

Module Contents

tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.PROJECT_ID[source]
tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.ENV_ID[source]
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.REGION = 'us-central1'[source]
tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.BQ_LOCATION = 'US'[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_VIEW_DATA_KEY[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)
       """
tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.create_bq_dataset[source]
tests.system.google.cloud.vertex_ai.example_vertex_ai_feature_store.test_run[source]

Was this entry helpful?