diff --git a/metricflow/dataflow/dataflow_plan.py b/metricflow/dataflow/dataflow_plan.py index d82db1baa..fea9cf99d 100644 --- a/metricflow/dataflow/dataflow_plan.py +++ b/metricflow/dataflow/dataflow_plan.py @@ -72,6 +72,9 @@ def functionally_identical(self, other_node: DataflowPlanNode) -> bool: def with_new_parents(self: NodeSelfT, new_parent_nodes: Sequence[DataflowPlanNode]) -> NodeSelfT: """Creates a node with the same behavior as this node, but with a different set of parents. + Callers are required to call this method with new parent nodes that are of the appropriate type and order as + required by the subclass. + typing.Self would be useful here, but not available in Python 3.8. """ raise NotImplementedError diff --git a/metricflow/dataflow/nodes/join_to_time_spine.py b/metricflow/dataflow/nodes/join_to_time_spine.py index 0e8d0a799..2ee94cc33 100644 --- a/metricflow/dataflow/nodes/join_to_time_spine.py +++ b/metricflow/dataflow/nodes/join_to_time_spine.py @@ -107,10 +107,12 @@ def functionally_identical(self, other_node: DataflowPlanNode) -> bool: # noqa: ) def with_new_parents(self, new_parent_nodes: Sequence[DataflowPlanNode]) -> JoinToTimeSpineNode: # noqa: D102 - assert len(new_parent_nodes) == 1 + assert len(new_parent_nodes) == 2 + metric_source_node = new_parent_nodes[0] + time_spine_node = new_parent_nodes[1] return JoinToTimeSpineNode.create( - metric_source_node=self.metric_source_node, - time_spine_node=self.time_spine_node, + metric_source_node=metric_source_node, + time_spine_node=time_spine_node, requested_agg_time_dimension_specs=self.requested_agg_time_dimension_specs, standard_offset_window=self.standard_offset_window, offset_to_grain=self.offset_to_grain,