diff --git a/.changes/unreleased/Under the Hood-20240612-233459.yaml b/.changes/unreleased/Under the Hood-20240612-233459.yaml new file mode 100644 index 0000000000..51158ff7fe --- /dev/null +++ b/.changes/unreleased/Under the Hood-20240612-233459.yaml @@ -0,0 +1,6 @@ +kind: Under the Hood +body: Added filtering for DWH validation tasks and saved query support +time: 2024-06-12T23:34:59.094903-04:00 +custom: + Author: WilliamDee + Issue: "1271" diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_metric_tasks__query0.sql index abb68a6f78..f4a478031a 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC(ds, day) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_saved_query_tasks__query0.sql index 48c1433c79..3dd7f7ca03 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/BigQuery/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC(ds, day) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Databricks/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/DuckDB/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Postgres/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Redshift/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Snowflake/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_metric_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_metric_tasks__query0.sql index 09c50dc53d..f705fe3237 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_metric_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_metric_tasks__query0.sql @@ -1,12 +1,7 @@ --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , SUM(count_dogs) AS count_dogs FROM ( - -- Read Elements From Semantic Model 'animals' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['count_dogs', 'metric_time__day'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , 1 AS count_dogs diff --git a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_saved_query_tasks__query0.sql b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_saved_query_tasks__query0.sql index 72c5cef5c9..d76ce501d3 100644 --- a/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_saved_query_tasks__query0.sql +++ b/tests_metricflow/snapshots/test_data_warehouse_tasks.py/str/Trino/test_build_saved_query_tasks__query0.sql @@ -1,23 +1,15 @@ --- Constrain Output with WHERE --- Aggregate Measures --- Compute Metrics via Expressions SELECT metric_time__day , listing__capacity_latest , SUM(bookings) AS bookings , SUM(instant_bookings) AS instant_bookings FROM ( - -- Join Standard Outputs - -- Pass Only Elements: ['bookings', 'instant_bookings', 'listing__capacity_latest', 'metric_time__day'] SELECT subq_2.metric_time__day AS metric_time__day , listings_latest_src_10000.capacity AS listing__capacity_latest , subq_2.bookings AS bookings , subq_2.instant_bookings AS instant_bookings FROM ( - -- Read Elements From Semantic Model 'bookings_source' - -- Metric Time Dimension 'ds' - -- Pass Only Elements: ['bookings', 'instant_bookings', 'metric_time__day', 'listing'] SELECT DATE_TRUNC('day', ds) AS metric_time__day , listing_id AS listing