diff --git a/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py b/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py index 3aec625a22..f6957e8fd7 100644 --- a/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/time_dimension_spec.py @@ -154,7 +154,6 @@ def with_grain(self, time_granularity: ExpandedTimeGranularity) -> TimeDimension aggregation_state=self.aggregation_state, ) - @property def with_base_grain(self) -> TimeDimensionSpec: # noqa: D102 return TimeDimensionSpec( element_name=self.element_name, diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index d98bcd4eae..22c381a039 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -798,7 +798,9 @@ def _build_plan_for_distinct_values( for time_dimension_spec in required_linkable_specs.time_dimension_specs: if time_dimension_spec.time_granularity.is_custom_granularity: - include_base_grain = time_dimension_spec.with_base_grain in required_linkable_specs.time_dimension_specs + include_base_grain = ( + time_dimension_spec.with_base_grain() in required_linkable_specs.time_dimension_specs + ) output_node = JoinToCustomGranularityNode.create( parent_node=output_node, time_dimension_spec=time_dimension_spec, @@ -1572,7 +1574,9 @@ def _build_aggregated_measure_from_measure_source_node( for time_dimension_spec in queried_linkable_specs.time_dimension_specs: if time_dimension_spec.time_granularity.is_custom_granularity: - include_base_grain = time_dimension_spec.with_base_grain in required_linkable_specs.time_dimension_specs + include_base_grain = ( + time_dimension_spec.with_base_grain() in required_linkable_specs.time_dimension_specs + ) unaggregated_measure_node = JoinToCustomGranularityNode.create( parent_node=unaggregated_measure_node, time_dimension_spec=time_dimension_spec, diff --git a/metricflow/dataflow/builder/node_evaluator.py b/metricflow/dataflow/builder/node_evaluator.py index f651e06de5..6b365cc09f 100644 --- a/metricflow/dataflow/builder/node_evaluator.py +++ b/metricflow/dataflow/builder/node_evaluator.py @@ -409,7 +409,7 @@ def evaluate_node( data_set_linkable_specs = candidate_spec_set.linkable_specs # Look for which nodes can satisfy the linkable specs at their base grains. Custom grains will be joined later. required_linkable_specs_with_base_grains = [ - spec.with_base_grain if isinstance(spec, TimeDimensionSpec) else spec for spec in required_linkable_specs + spec.with_base_grain() if isinstance(spec, TimeDimensionSpec) else spec for spec in required_linkable_specs ] # These are linkable specs in the start node data set. Those are considered "local". diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index 51276297c9..d3041bee2c 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -1436,7 +1436,7 @@ def visit_join_to_custom_granularity_node(self, node: JoinToCustomGranularityNod parent_alias = parent_data_set.checked_sql_select_node.from_source_alias parent_time_dimension_instance: Optional[TimeDimensionInstance] = None for instance in parent_data_set.instance_set.time_dimension_instances: - if instance.spec == node.time_dimension_spec.with_base_grain: + if instance.spec == node.time_dimension_spec.with_base_grain(): parent_time_dimension_instance = instance break assert parent_time_dimension_instance, (