From fb1588ce1513532804484bbd9dfb649585321ef8 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Tue, 24 Sep 2024 08:33:46 -0700 Subject: [PATCH] Change order of descriptions in SQL output --- metricflow/plan_conversion/dataflow_to_sql.py | 18 +++++++++--------- ...e_metric_with_custom_granularity__plan0.sql | 2 +- ...ith_custom_granularity__plan0_optimized.sql | 2 +- ...d_metric_with_custom_granularity__plan0.sql | 4 ++-- ...ith_custom_granularity__plan0_optimized.sql | 2 +- ...rity_joined_to_non_default_grain__plan0.sql | 2 +- ...d_to_non_default_grain__plan0_optimized.sql | 2 +- ..._metrics_with_custom_granularity__plan0.sql | 4 ++-- ...ith_custom_granularity__plan0_optimized.sql | 4 ++-- ...rity_joined_to_non_default_grain__plan0.sql | 2 +- ...d_to_non_default_grain__plan0_optimized.sql | 2 +- ...c_custom_granularity_metric_time__plan0.sql | 2 +- ...ranularity_metric_time__plan0_optimized.sql | 2 +- ...stom_granularity_non_metric_time__plan0.sql | 2 +- ...larity_non_metric_time__plan0_optimized.sql | 2 +- ...s_with_custom_granularity_filter__plan0.sql | 2 +- ...tom_granularity_filter__plan0_optimized.sql | 2 +- ...anularity_in_filter_and_group_by__plan0.sql | 2 +- ...in_filter_and_group_by__plan0_optimized.sql | 2 +- ...e_metric_with_custom_granularity__plan0.sql | 2 +- ...ith_custom_granularity__plan0_optimized.sql | 2 +- ...with_custom_granularity_and_join__plan0.sql | 2 +- ...m_granularity_and_join__plan0_optimized.sql | 2 +- ...c_with_custom_granularity_filter__plan0.sql | 2 +- ...tom_granularity_filter__plan0_optimized.sql | 2 +- ...anularity_in_filter_and_group_by__plan0.sql | 2 +- ...in_filter_and_group_by__plan0_optimized.sql | 2 +- 27 files changed, 38 insertions(+), 38 deletions(-) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 54433f27e1..7456ba6f5c 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1087,9 +1087,9 @@ def visit_metric_time_dimension_transform_node(self, node: MetricTimeDimensionTr spec=metric_time_dimension_spec, ) ) - output_column_to_input_column[ - metric_time_dimension_column_association.column_name - ] = matching_time_dimension_instance.associated_column.column_name + output_column_to_input_column[metric_time_dimension_column_association.column_name] = ( + matching_time_dimension_instance.associated_column.column_name + ) output_instance_set = InstanceSet( measure_instances=tuple(output_measure_instances), @@ -1324,11 +1324,11 @@ def visit_join_to_time_spine_node(self, node: JoinToTimeSpineNode) -> SqlDataSet and len(time_spine_dataset.checked_sql_select_node.select_columns) == 1 ), "Time spine dataset not configured properly. Expected exactly one column." original_time_spine_dim_instance = time_spine_dataset.instance_set.time_dimension_instances[0] - time_spine_column_select_expr: Union[ - SqlColumnReferenceExpression, SqlDateTruncExpression - ] = SqlColumnReferenceExpression.create( - SqlColumnReference( - table_alias=time_spine_alias, column_name=original_time_spine_dim_instance.spec.qualified_name + time_spine_column_select_expr: Union[SqlColumnReferenceExpression, SqlDateTruncExpression] = ( + SqlColumnReferenceExpression.create( + SqlColumnReference( + table_alias=time_spine_alias, column_name=original_time_spine_dim_instance.spec.qualified_name + ) ) ) @@ -1491,7 +1491,7 @@ def visit_join_to_custom_granularity_node(self, node: JoinToCustomGranularityNod return SqlDataSet( instance_set=InstanceSet.merge([time_spine_instance_set, parent_data_set.instance_set]), sql_select_node=SqlSelectStatementNode.create( - description=node.description + "\n" + parent_data_set.checked_sql_select_node.description, + description=parent_data_set.checked_sql_select_node.description + "\n" + node.description, select_columns=parent_data_set.checked_sql_select_node.select_columns + time_spine_select_columns, from_source=parent_data_set.checked_sql_select_node.from_source, from_source_alias=parent_alias, diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0.sql index 8427c77286..702792fa53 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0.sql @@ -20,8 +20,8 @@ FROM ( , subq_6.metric_time__day , SUM(subq_6.txn_revenue) AS txn_revenue FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['txn_revenue', 'metric_time__day', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_4.metric_time__day AS metric_time__day , subq_4.txn_revenue AS txn_revenue diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0_optimized.sql index f8ff3bdf72..731247315b 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_cumulative_metric_with_custom_granularity__plan0_optimized.sql @@ -9,8 +9,8 @@ FROM ( metric_time__martian_day , AVG(txn_revenue) OVER (PARTITION BY metric_time__martian_day) AS trailing_2_months_revenue FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['txn_revenue', 'metric_time__day', 'metric_time__day'] + -- Join to Custom Granularity Dataset -- Aggregate Measures SELECT subq_15.martian_day AS metric_time__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0.sql index 4bb74edcf5..5e1a1c349e 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0.sql @@ -24,8 +24,8 @@ FROM ( subq_3.booking__ds__martian_day , subq_3.booking_value FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['booking_value', 'booking__ds__day'] + -- Join to Custom Granularity Dataset SELECT subq_1.booking__ds__day AS booking__ds__day , subq_1.booking_value AS booking_value @@ -251,8 +251,8 @@ FROM ( subq_10.booking__ds__martian_day , subq_10.bookers FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookers', 'booking__ds__day'] + -- Join to Custom Granularity Dataset SELECT subq_8.booking__ds__day AS booking__ds__day , subq_8.bookers AS bookers diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0_optimized.sql index a814ffb25c..3bc3f746f5 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_derived_metric_with_custom_granularity__plan0_optimized.sql @@ -3,8 +3,8 @@ SELECT booking__ds__martian_day , booking_value * 0.05 / bookers AS booking_fees_per_booker FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['booking_value', 'bookers', 'booking__ds__day'] + -- Join to Custom Granularity Dataset -- Pass Only Elements: ['booking_value', 'bookers', 'booking__ds__martian_day'] -- Aggregate Measures -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0.sql index 413ba9812a..bc46bbc2a8 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0.sql @@ -16,8 +16,8 @@ FROM ( , subq_3.listing__ds__month , subq_3.listings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__ds__month'] + -- Join to Custom Granularity Dataset SELECT subq_1.listing__ds__month AS listing__ds__month , subq_1.metric_time__day AS metric_time__day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql index 68bec8d0fd..2f45574e41 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql @@ -1,5 +1,5 @@ --- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__day', 'listing__ds__month'] +-- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__martian_day', 'listing__ds__month'] -- Aggregate Measures -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0.sql index 0269bead43..5059d9a939 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0.sql @@ -19,8 +19,8 @@ FROM ( subq_3.metric_time__martian_day , subq_3.bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_1.metric_time__day AS metric_time__day , subq_1.bookings AS bookings @@ -246,8 +246,8 @@ FULL OUTER JOIN ( subq_10.metric_time__martian_day , subq_10.listings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_8.metric_time__day AS metric_time__day , subq_8.listings AS listings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0_optimized.sql index 769208fd3c..e5b55102e9 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_multiple_metrics_with_custom_granularity__plan0_optimized.sql @@ -4,8 +4,8 @@ SELECT , MAX(subq_20.bookings) AS bookings , MAX(subq_27.listings) AS listings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__martian_day'] -- Aggregate Measures -- Compute Metrics via Expressions @@ -28,8 +28,8 @@ FROM ( subq_16.martian_day ) subq_20 FULL OUTER JOIN ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__day'] + -- Join to Custom Granularity Dataset -- Pass Only Elements: ['listings', 'metric_time__martian_day'] -- Aggregate Measures -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql index 3c9174a764..5cf61b70ac 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0.sql @@ -5,9 +5,9 @@ SELECT , subq_6.user__bio_added_ts__month , subq_6.metric_time__day FROM ( + -- Join Standard Outputs -- Join to Custom Granularity Dataset -- Join to Custom Granularity Dataset - -- Join Standard Outputs SELECT subq_0.ds__day AS ds__day , subq_0.ds__week AS ds__week diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql index 90e8cc46a1..f4cb2ff0cf 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_joined_to_non_default_grain__plan0_optimized.sql @@ -1,6 +1,6 @@ +-- Join Standard Outputs -- Join to Custom Granularity Dataset -- Join to Custom Granularity Dataset --- Join Standard Outputs -- Pass Only Elements: ['metric_time__day', 'metric_time__martian_day', 'user__bio_added_ts__martian_day', 'user__bio_added_ts__month'] SELECT subq_12.martian_day AS user__bio_added_ts__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql index 41027c1c68..48672d84f6 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0.sql @@ -2,8 +2,8 @@ SELECT subq_2.metric_time__martian_day FROM ( - -- Join to Custom Granularity Dataset -- Metric Time Dimension 'ds' + -- Join to Custom Granularity Dataset SELECT subq_0.ds__day AS ds__day , subq_0.ds__week AS ds__week diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql index b0352e403f..cb56b24088 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_metric_time__plan0_optimized.sql @@ -1,5 +1,5 @@ --- Join to Custom Granularity Dataset -- Metric Time Dimension 'ds' +-- Join to Custom Granularity Dataset -- Pass Only Elements: ['metric_time__martian_day',] SELECT subq_4.martian_day AS metric_time__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0.sql index 4ac5aec421..7d3bcb3d0c 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0.sql @@ -2,8 +2,8 @@ SELECT subq_1.booking__ds__martian_day FROM ( - -- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'bookings_source' + -- Join to Custom Granularity Dataset SELECT 1 AS bookings , CASE WHEN is_instant THEN 1 ELSE 0 END AS instant_bookings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0_optimized.sql index 55148171fa..d800e789e7 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metric_custom_granularity_non_metric_time__plan0_optimized.sql @@ -1,5 +1,5 @@ --- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'bookings_source' +-- Join to Custom Granularity Dataset -- Pass Only Elements: ['booking__ds__martian_day',] SELECT subq_2.martian_day AS booking__ds__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0.sql index 38d38057ee..05a7977e3d 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0.sql @@ -62,8 +62,8 @@ FROM ( , subq_1.largest_listing , subq_1.smallest_listing FROM ( - -- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'listings_latest' + -- Join to Custom Granularity Dataset SELECT 1 AS listings , listings_latest_src_28000.capacity AS largest_listing diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0_optimized.sql index 84a7438c8d..bce724a864 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_filter__plan0_optimized.sql @@ -3,8 +3,8 @@ SELECT listing__ds__day FROM ( - -- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'listings_latest' + -- Join to Custom Granularity Dataset SELECT DATE_TRUNC('day', listings_latest_src_28000.created_at) AS listing__ds__day , subq_3.martian_day AS listing__ds__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0.sql index 58af5732eb..062e6d8cbe 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0.sql @@ -62,8 +62,8 @@ FROM ( , subq_1.largest_listing , subq_1.smallest_listing FROM ( - -- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'listings_latest' + -- Join to Custom Granularity Dataset SELECT 1 AS listings , listings_latest_src_28000.capacity AS largest_listing diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql index 51670a9308..3dd32191d6 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_no_metrics_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql @@ -3,8 +3,8 @@ SELECT listing__ds__martian_day FROM ( - -- Join to Custom Granularity Dataset -- Read Elements From Semantic Model 'listings_latest' + -- Join to Custom Granularity Dataset SELECT subq_3.martian_day AS listing__ds__martian_day FROM ***************************.dim_listings_latest listings_latest_src_28000 diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0.sql index d8fbf55a2f..5b7bb60efa 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0.sql @@ -13,8 +13,8 @@ FROM ( subq_3.booking__ds__martian_day , subq_3.bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'booking__ds__day'] + -- Join to Custom Granularity Dataset SELECT subq_1.booking__ds__day AS booking__ds__day , subq_1.bookings AS bookings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0_optimized.sql index 76fafece19..fade916c75 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity__plan0_optimized.sql @@ -1,5 +1,5 @@ --- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'booking__ds__day'] +-- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'booking__ds__martian_day'] -- Aggregate Measures -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0.sql index cf28142373..1998864955 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0.sql @@ -13,8 +13,8 @@ FROM ( subq_8.listing__ds__martian_day , subq_8.bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'listing__ds__day'] + -- Join to Custom Granularity Dataset SELECT subq_6.listing__ds__day AS listing__ds__day , subq_6.bookings AS bookings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0_optimized.sql index 0007ae475a..f36ac75d16 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_and_join__plan0_optimized.sql @@ -1,5 +1,5 @@ --- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'listing__ds__day'] +-- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'listing__ds__martian_day'] -- Aggregate Measures -- Compute Metrics via Expressions diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0.sql index 742d8fe88f..d6197e5be1 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0.sql @@ -16,8 +16,8 @@ FROM ( , subq_3.metric_time__day , subq_3.bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_1.metric_time__day AS metric_time__day , subq_1.bookings AS bookings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0_optimized.sql index ad767fe7d4..28f1b6995f 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_filter__plan0_optimized.sql @@ -5,8 +5,8 @@ SELECT SUM(bookings) AS bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_8.bookings AS bookings , subq_9.martian_day AS metric_time__martian_day diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0.sql index 5a1f71d3c0..07df220f23 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0.sql @@ -19,8 +19,8 @@ FROM ( , subq_3.metric_time__day , subq_3.bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_1.metric_time__day AS metric_time__day , subq_1.bookings AS bookings diff --git a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql index afd4353c18..8c1f6de498 100644 --- a/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql +++ b/tests_metricflow/snapshots/test_custom_granularity.py/SqlQueryPlan/DuckDB/test_simple_metric_with_custom_granularity_in_filter_and_group_by__plan0_optimized.sql @@ -6,8 +6,8 @@ SELECT metric_time__martian_day , SUM(bookings) AS bookings FROM ( - -- Join to Custom Granularity Dataset -- Pass Only Elements: ['bookings', 'metric_time__day'] + -- Join to Custom Granularity Dataset SELECT subq_8.bookings AS bookings , subq_9.martian_day AS metric_time__martian_day