From 2074663430ce2adb639829a63f0c9c98f716af90 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Thu, 21 Sep 2023 21:33:40 -0700 Subject: [PATCH] Remove unneeded changes --- metricflow/dataflow/builder/dataflow_plan_builder.py | 5 +---- metricflow/engine/metricflow_engine.py | 4 ---- metricflow/test/dataflow/builder/test_cyclic_join.py | 1 - metricflow/test/fixtures/dataflow_fixtures.py | 3 --- metricflow/test/fixtures/model_fixtures.py | 4 ---- .../DataflowPlan/test_cyclic_join__dfp_0.xml | 6 +++--- .../DataflowPlan/test_distinct_values_plan__dfp_0.xml | 4 ++-- .../DataflowPlan/test_multihop_join_plan__dfp_0.xml | 8 ++++---- 8 files changed, 10 insertions(+), 25 deletions(-) diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index 82beb89282..d1c91139b3 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -116,7 +116,6 @@ class DataflowPlanBuilder: def __init__( # noqa: D self, source_nodes: Sequence[BaseOutput], - source_nodes_without_measures: Sequence[BaseOutput], semantic_manifest_lookup: SemanticManifestLookup, cost_function: DataflowPlanNodeCostFunction = DefaultCostFunction(), node_output_resolver: Optional[DataflowPlanNodeOutputDataSetResolver] = None, @@ -127,7 +126,6 @@ def __init__( # noqa: D self._metric_time_dimension_reference = DataSet.metric_time_dimension_reference() self._cost_function = cost_function self._source_nodes = source_nodes - self._source_nodes_without_measures = source_nodes_without_measures self._column_association_resolver = ( DunderColumnAssociationResolver(semantic_manifest_lookup) if not column_association_resolver @@ -457,13 +455,12 @@ def _find_dataflow_recipe( time_range_constraint: Optional[TimeRangeConstraint] = None, ) -> Optional[DataflowRecipe]: linkable_specs = linkable_spec_set.as_tuple + source_nodes = self._source_nodes if measure_spec_properties: - source_nodes = self._source_nodes potential_source_nodes: Sequence[BaseOutput] = self._select_source_nodes_with_measures( measure_specs=set(measure_spec_properties.measure_specs), source_nodes=source_nodes ) else: - source_nodes = self._source_nodes_without_measures potential_source_nodes = self._select_source_nodes_with_linkable_specs( linkable_specs=linkable_spec_set, source_nodes=source_nodes ) diff --git a/metricflow/engine/metricflow_engine.py b/metricflow/engine/metricflow_engine.py index bd160b7d37..5039d3dee6 100644 --- a/metricflow/engine/metricflow_engine.py +++ b/metricflow/engine/metricflow_engine.py @@ -347,9 +347,6 @@ def __init__( source_node_builder = SourceNodeBuilder(self._semantic_manifest_lookup) source_nodes = source_node_builder.create_from_data_sets(self._source_data_sets) - source_nodes_without_measures = source_node_builder.create_from_data_sets( - self._source_data_sets, with_measures=False - ) node_output_resolver = DataflowPlanNodeOutputDataSetResolver( column_association_resolver=DunderColumnAssociationResolver(semantic_manifest_lookup), @@ -358,7 +355,6 @@ def __init__( self._dataflow_plan_builder = DataflowPlanBuilder( source_nodes=source_nodes, - source_nodes_without_measures=source_nodes_without_measures, semantic_manifest_lookup=self._semantic_manifest_lookup, ) self._to_sql_query_plan_converter = DataflowToSqlQueryPlanConverter( diff --git a/metricflow/test/dataflow/builder/test_cyclic_join.py b/metricflow/test/dataflow/builder/test_cyclic_join.py index 73a9aed2ec..8762e45ce3 100644 --- a/metricflow/test/dataflow/builder/test_cyclic_join.py +++ b/metricflow/test/dataflow/builder/test_cyclic_join.py @@ -34,7 +34,6 @@ def cyclic_join_manifest_dataflow_plan_builder( # noqa: D return DataflowPlanBuilder( source_nodes=consistent_id_object_repository.cyclic_join_source_nodes, - source_nodes_without_measures=consistent_id_object_repository.simple_model_source_nodes_without_measures, semantic_manifest_lookup=cyclic_join_semantic_manifest_lookup, cost_function=DefaultCostFunction(), ) diff --git a/metricflow/test/fixtures/dataflow_fixtures.py b/metricflow/test/fixtures/dataflow_fixtures.py index a87324b146..06616aa7f1 100644 --- a/metricflow/test/fixtures/dataflow_fixtures.py +++ b/metricflow/test/fixtures/dataflow_fixtures.py @@ -34,7 +34,6 @@ def dataflow_plan_builder( # noqa: D ) -> DataflowPlanBuilder: return DataflowPlanBuilder( source_nodes=consistent_id_object_repository.simple_model_source_nodes, - source_nodes_without_measures=consistent_id_object_repository.simple_model_source_nodes_without_measures, semantic_manifest_lookup=simple_semantic_manifest_lookup, cost_function=DefaultCostFunction(), ) @@ -48,7 +47,6 @@ def multihop_dataflow_plan_builder( # noqa: D ) -> DataflowPlanBuilder: return DataflowPlanBuilder( source_nodes=consistent_id_object_repository.multihop_model_source_nodes, - source_nodes_without_measures=consistent_id_object_repository.simple_model_source_nodes_without_measures, semantic_manifest_lookup=multi_hop_join_semantic_manifest_lookup, cost_function=DefaultCostFunction(), ) @@ -70,7 +68,6 @@ def scd_dataflow_plan_builder( # noqa: D ) -> DataflowPlanBuilder: return DataflowPlanBuilder( source_nodes=consistent_id_object_repository.scd_model_source_nodes, - source_nodes_without_measures=consistent_id_object_repository.simple_model_source_nodes_without_measures, semantic_manifest_lookup=scd_semantic_manifest_lookup, cost_function=DefaultCostFunction(), column_association_resolver=scd_column_association_resolver, diff --git a/metricflow/test/fixtures/model_fixtures.py b/metricflow/test/fixtures/model_fixtures.py index c9f7021182..e4cf809b12 100644 --- a/metricflow/test/fixtures/model_fixtures.py +++ b/metricflow/test/fixtures/model_fixtures.py @@ -82,7 +82,6 @@ class ConsistentIdObjectRepository: simple_model_data_sets: OrderedDict[str, SemanticModelDataSet] simple_model_read_nodes: OrderedDict[str, ReadSqlSourceNode] simple_model_source_nodes: Sequence[BaseOutput] - simple_model_source_nodes_without_measures: Sequence[BaseOutput] multihop_model_read_nodes: OrderedDict[str, ReadSqlSourceNode] multihop_model_source_nodes: Sequence[BaseOutput] @@ -116,9 +115,6 @@ def consistent_id_object_repository( simple_model_data_sets=sm_data_sets, simple_model_read_nodes=_data_set_to_read_nodes(sm_data_sets), simple_model_source_nodes=_data_set_to_source_nodes(simple_semantic_manifest_lookup, sm_data_sets), - simple_model_source_nodes_without_measures=_data_set_to_source_nodes( - simple_semantic_manifest_lookup, sm_data_sets, with_measures=False - ), multihop_model_read_nodes=_data_set_to_read_nodes(multihop_data_sets), multihop_model_source_nodes=_data_set_to_source_nodes( multi_hop_join_semantic_manifest_lookup, multihop_data_sets diff --git a/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml b/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml index 30f00fecf5..1d4bea6e1e 100644 --- a/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml +++ b/metricflow/test/snapshots/test_cyclic_join.py/DataflowPlan/test_cyclic_join__dfp_0.xml @@ -58,12 +58,12 @@ - + - + @@ -86,7 +86,7 @@ - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml index 06f25732e1..9a9b6b09f4 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml @@ -42,12 +42,12 @@ - + - + diff --git a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml index 434a4c173a..baa48cf4f7 100644 --- a/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml +++ b/metricflow/test/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_multihop_join_plan__dfp_0.xml @@ -77,12 +77,12 @@ - + - + @@ -136,7 +136,7 @@ - + @@ -359,7 +359,7 @@ - +