Skip to content

Commit

Permalink
Remove use_custom_agg_time_dimension property from JoinToTimeSpineNode
Browse files Browse the repository at this point in the history
It is no longer used.
  • Loading branch information
courtneyholcomb committed Nov 20, 2024
1 parent 81e54f2 commit 2f17fa0
Show file tree
Hide file tree
Showing 22 changed files with 0 additions and 43 deletions.
3 changes: 0 additions & 3 deletions metricflow/dataflow/builder/dataflow_plan_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,7 +649,6 @@ def _build_derived_metric_output_node(
output_node = JoinToTimeSpineNode.create(
parent_node=output_node,
requested_agg_time_dimension_specs=queried_agg_time_dimension_specs,
use_custom_agg_time_dimension=not queried_linkable_specs.contains_metric_time,
time_range_constraint=predicate_pushdown_state.time_range_constraint,
offset_window=metric_spec.offset_window,
offset_to_grain=metric_spec.offset_to_grain,
Expand Down Expand Up @@ -1630,7 +1629,6 @@ def _build_aggregated_measure_from_measure_source_node(
unaggregated_measure_node = JoinToTimeSpineNode.create(
parent_node=unaggregated_measure_node,
requested_agg_time_dimension_specs=base_agg_time_dimension_specs,
use_custom_agg_time_dimension=not queried_linkable_specs.contains_metric_time,
time_range_constraint=predicate_pushdown_state.time_range_constraint,
offset_window=before_aggregation_time_spine_join_description.offset_window,
offset_to_grain=before_aggregation_time_spine_join_description.offset_to_grain,
Expand Down Expand Up @@ -1705,7 +1703,6 @@ def _build_aggregated_measure_from_measure_source_node(
output_node: DataflowPlanNode = JoinToTimeSpineNode.create(
parent_node=aggregate_measures_node,
requested_agg_time_dimension_specs=queried_agg_time_dimension_specs,
use_custom_agg_time_dimension=not queried_linkable_specs.contains_metric_time,
join_type=after_aggregation_time_spine_join_description.join_type,
time_range_constraint=predicate_pushdown_state.time_range_constraint,
offset_window=after_aggregation_time_spine_join_description.offset_window,
Expand Down
7 changes: 0 additions & 7 deletions metricflow/dataflow/nodes/join_to_time_spine.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,13 @@ class JoinToTimeSpineNode(DataflowPlanNode, ABC):
Attributes:
requested_agg_time_dimension_specs: Time dimensions requested in the query.
use_custom_agg_time_dimension: Indicates if agg_time_dimension should be used in join. If false, uses metric_time.
join_type: Join type to use when joining to time spine.
time_range_constraint: Time range to constrain the time spine to.
offset_window: Time window to offset the parent dataset by when joining to time spine.
offset_to_grain: Granularity period to offset the parent dataset to when joining to time spine.
"""

requested_agg_time_dimension_specs: Sequence[TimeDimensionSpec]
use_custom_agg_time_dimension: bool
join_type: SqlJoinType
time_range_constraint: Optional[TimeRangeConstraint]
offset_window: Optional[MetricTimeWindow]
Expand All @@ -54,7 +52,6 @@ def __post_init__(self) -> None: # noqa: D105
def create( # noqa: D102
parent_node: DataflowPlanNode,
requested_agg_time_dimension_specs: Sequence[TimeDimensionSpec],
use_custom_agg_time_dimension: bool,
join_type: SqlJoinType,
time_range_constraint: Optional[TimeRangeConstraint] = None,
offset_window: Optional[MetricTimeWindow] = None,
Expand All @@ -64,7 +61,6 @@ def create( # noqa: D102
return JoinToTimeSpineNode(
parent_nodes=(parent_node,),
requested_agg_time_dimension_specs=tuple(requested_agg_time_dimension_specs),
use_custom_agg_time_dimension=use_custom_agg_time_dimension,
join_type=join_type,
time_range_constraint=time_range_constraint,
offset_window=offset_window,
Expand All @@ -87,7 +83,6 @@ def description(self) -> str: # noqa: D102
def displayed_properties(self) -> Sequence[DisplayedProperty]: # noqa: D102
props = tuple(super().displayed_properties) + (
DisplayedProperty("requested_agg_time_dimension_specs", self.requested_agg_time_dimension_specs),
DisplayedProperty("use_custom_agg_time_dimension", self.use_custom_agg_time_dimension),
DisplayedProperty("join_type", self.join_type),
)
if self.offset_window:
Expand Down Expand Up @@ -115,7 +110,6 @@ def functionally_identical(self, other_node: DataflowPlanNode) -> bool: # noqa:
and other_node.offset_window == self.offset_window
and other_node.offset_to_grain == self.offset_to_grain
and other_node.requested_agg_time_dimension_specs == self.requested_agg_time_dimension_specs
and other_node.use_custom_agg_time_dimension == self.use_custom_agg_time_dimension
and other_node.join_type == self.join_type
and other_node.time_spine_filters == self.time_spine_filters
)
Expand All @@ -125,7 +119,6 @@ def with_new_parents(self, new_parent_nodes: Sequence[DataflowPlanNode]) -> Join
return JoinToTimeSpineNode.create(
parent_node=new_parent_nodes[0],
requested_agg_time_dimension_specs=self.requested_agg_time_dimension_specs,
use_custom_agg_time_dimension=self.use_custom_agg_time_dimension,
time_range_constraint=self.time_range_constraint,
offset_window=self.offset_window,
offset_to_grain=self.offset_to_grain,
Expand Down
3 changes: 0 additions & 3 deletions tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,6 @@ def test_join_to_time_spine_node_without_offset(
join_to_time_spine_node = JoinToTimeSpineNode.create(
parent_node=compute_metrics_node,
requested_agg_time_dimension_specs=[MTD_SPEC_DAY],
use_custom_agg_time_dimension=False,
time_range_constraint=TimeRangeConstraint(
start_time=as_datetime("2020-01-01"), end_time=as_datetime("2021-01-01")
),
Expand Down Expand Up @@ -681,7 +680,6 @@ def test_join_to_time_spine_node_with_offset_window(
join_to_time_spine_node = JoinToTimeSpineNode.create(
parent_node=compute_metrics_node,
requested_agg_time_dimension_specs=[MTD_SPEC_DAY],
use_custom_agg_time_dimension=False,
time_range_constraint=TimeRangeConstraint(
start_time=as_datetime("2020-01-01"), end_time=as_datetime("2021-01-01")
),
Expand Down Expand Up @@ -756,7 +754,6 @@ def test_join_to_time_spine_node_with_offset_to_grain(
join_to_time_spine_node = JoinToTimeSpineNode.create(
parent_node=compute_metrics_node,
requested_agg_time_dimension_specs=[MTD_SPEC_DAY],
use_custom_agg_time_dimension=False,
time_range_constraint=TimeRangeConstraint(
start_time=as_datetime("2020-01-01"), end_time=as_datetime("2021-01-01")
),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_to_grain = MONTH -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=5, granularity=DAY) -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='month', base_granularity=MONTH), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=5, granularity=DAY) -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=2, granularity=DAY) -->
<JoinOverTimeRangeNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
Expand Down Expand Up @@ -80,7 +79,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
Expand All @@ -105,7 +103,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=14, granularity=DAY) -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<!-- time_range_constraint = -->
<!-- TimeRangeConstraint( -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=2, granularity=DAY) -->
<ComputeMetricsNode>
Expand Down Expand Up @@ -63,7 +62,6 @@ test_filename: test_dataflow_plan_builder.py
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=5, granularity=DAY) -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='month', base_granularity=MONTH), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_to_grain = MONTH -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ docstring:
<!-- ), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=1, granularity=WEEK) -->
<MetricTimeDimensionTransformNode>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_to_grain = MONTH -->
<!-- time_range_constraint = -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=10, granularity=DAY) -->
<!-- time_range_constraint = -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- time_range_constraint = -->
<!-- TimeRangeConstraint( -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
Expand Down Expand Up @@ -297,7 +296,6 @@ docstring:
<!-- time_granularity=ExpandedTimeGranularity(name='day', base_granularity=DAY), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = LEFT_OUTER -->
<AggregateMeasuresNode>
<!-- description = 'Aggregate Measures' -->
Expand Down Expand Up @@ -382,7 +380,6 @@ docstring:
<!-- ), -->
<!-- ), -->
<!-- ) -->
<!-- use_custom_agg_time_dimension = False -->
<!-- join_type = INNER -->
<!-- offset_window = PydanticMetricTimeWindow(count=14, granularity=DAY) -->
<MetricTimeDimensionTransformNode>
Expand Down
Loading

0 comments on commit 2f17fa0

Please sign in to comment.