From 975446b69277fd6fa392297f2cfe644b45ad8f6e Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 2 Oct 2024 07:00:47 -0700 Subject: [PATCH] Don't drop parent attributes when joining to custom granularity (#1439) An oversight when building this SQL rendering logic - we were dropping some of the SQL select node attributes from the dataset when joining to time spine. This fixes that. I'm not actually sure of what query scenario might have this attributes before the custom granularity join, so this is more of a "just in case" fix. --- metricflow/plan_conversion/dataflow_to_sql.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 64b8ff5561..87be3f85cd 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1499,6 +1499,11 @@ def visit_join_to_custom_granularity_node(self, node: JoinToCustomGranularityNod from_source=parent_data_set.checked_sql_select_node.from_source, from_source_alias=parent_alias, join_descs=parent_data_set.checked_sql_select_node.join_descs + (join_description,), + where=parent_data_set.checked_sql_select_node.where, + group_bys=parent_data_set.checked_sql_select_node.group_bys, + order_bys=parent_data_set.checked_sql_select_node.order_bys, + limit=parent_data_set.checked_sql_select_node.limit, + distinct=parent_data_set.checked_sql_select_node.distinct, ), )