From 5bc927b97024c8fd2e9dd38a34bac81321c6aecf Mon Sep 17 00:00:00 2001 From: Paul Yang Date: Tue, 16 Jul 2024 18:07:06 -0700 Subject: [PATCH] Use `LinkableSpecSet` in `WhereFilterSpec` (#1335) In `WhereFilterSpec`, the field `linkable_specs` can't be used with `SerializableDataclass` since it's an interface. This PR changes that field to a `LinkableSpecSet`. --- .../model/semantics/linkable_element.py | 10 +- .../specs/where_filter/where_filter_spec.py | 11 +- .../where_filter/where_filter_transform.py | 3 +- .../test_predicate_pushdown_optimizer.py | 16 +- .../test_dataflow_to_sql_plan.py | 13 +- .../test_distinct_values_plan__dfp_0.xml | 18 +- ..._distinct_values_plan_with_join__dfp_0.xml | 18 +- ...join_to_time_spine_with_filters__dfp_0.xml | 128 +++++----- .../test_measure_constraint_plan__dfp_0.xml | 224 ++++++++++-------- ...traint_with_reused_measure_plan__dfp_0.xml | 94 ++++---- ...t_metric_in_metric_where_filter__dfp_0.xml | 36 +-- ...st_metric_in_query_where_filter__dfp_0.xml | 84 ++++--- ...ry_have_different_granularities__dfp_0.xml | 128 +++++----- ...ry_have_different_granularities__dfp_0.xml | 119 +++++----- .../test_where_constrained_plan__dfp_0.xml | 36 ++- ...constrained_plan_time_dimension__dfp_0.xml | 114 +++++---- ...ained_with_common_linkable_plan__dfp_0.xml | 36 ++- ...rsion_metric_predicate_pushdown__dfp_0.xml | 36 ++- ...sion_metric_predicate_pushdown__dfpo_0.xml | 36 ++- ...ative_metric_predicate_pushdown__dfp_0.xml | 36 ++- ...tive_metric_predicate_pushdown__dfpo_0.xml | 38 +-- ...spine_metric_predicate_pushdown__dfp_0.xml | 146 +++++++----- ...pine_metric_predicate_pushdown__dfpo_0.xml | 150 +++++++----- ...ost_agg_join_predicate_pushdown__dfp_0.xml | 182 ++++++++------ ...st_agg_join_predicate_pushdown__dfpo_0.xml | 186 +++++++++------ ...ffset_metric_predicate_pushdown__dfp_0.xml | 146 +++++++----- ...fset_metric_predicate_pushdown__dfpo_0.xml | 150 +++++++----- ...imple_join_categorical_pushdown__dfp_0.xml | 36 ++- ...mple_join_categorical_pushdown__dfpo_0.xml | 36 ++- ..._time_pushdown_with_two_targets__dfp_0.xml | 114 +++++---- ...time_pushdown_with_two_targets__dfpo_0.xml | 114 +++++---- ...constrained_metric_not_combined__dfp_0.xml | 18 +- ...onstrained_metric_not_combined__dfpo_0.xml | 18 +- 33 files changed, 1497 insertions(+), 1033 deletions(-) diff --git a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py index 29fd9a0d64..b1270b92f1 100644 --- a/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py +++ b/metricflow-semantics/metricflow_semantics/model/semantics/linkable_element.py @@ -87,7 +87,7 @@ def __post_init__(self) -> None: @dataclass(frozen=True) -class SemanticModelJoinPathElement: +class SemanticModelJoinPathElement(SerializableDataclass): """Describes joining a semantic model by the given entity.""" semantic_model_reference: SemanticModelReference @@ -297,7 +297,7 @@ def metric_subquery_entity_links(self) -> Tuple[EntityReference, ...]: @dataclass(frozen=True) -class SemanticModelJoinPath(SemanticModelDerivation): +class SemanticModelJoinPath(SemanticModelDerivation, SerializableDataclass): """Describes a series of joins between the measure semantic model, and other semantic models by entity. For example: @@ -357,14 +357,14 @@ def derived_from_semantic_models(self) -> Sequence[SemanticModelReference]: @dataclass(frozen=True) -class MetricSubqueryJoinPathElement: +class MetricSubqueryJoinPathElement(SerializableDataclass): """Describes joining from a semantic model to a metric subquery. Args: metric_reference: The metric that's aggregated in the subquery. derived_from_semantic_models: The semantic models that the measure's input metrics are defined in. join_on_entity: The entity that the metric is grouped by in the subquery. This will be updated in V2 to allow a list - of entitites & dimensions. + of entities & dimensions. entity_links: Sequence of entities joined to get from a metric source to the `join_on_entity`. Should not include the `join_on_entity`. metric_to_entity_join_path: Describes the join path used in the subquery to join the metric to the `join_on_entity`. @@ -384,7 +384,7 @@ def __post_init__(self) -> None: # noqa: D105 @dataclass(frozen=True) -class SemanticModelToMetricSubqueryJoinPath: +class SemanticModelToMetricSubqueryJoinPath(SerializableDataclass): """Describes how to join from a semantic model to a metric subquery. Starts with semantic model join path, if needed. Always ends with metric subquery join path. diff --git a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_spec.py b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_spec.py index 4ab7d1faf6..4491201e76 100644 --- a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_spec.py +++ b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_spec.py @@ -10,6 +10,7 @@ from metricflow_semantics.collection_helpers.merger import Mergeable from metricflow_semantics.model.semantics.linkable_element import LinkableElement from metricflow_semantics.specs.instance_spec import LinkableInstanceSpec +from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters @@ -45,8 +46,12 @@ class WhereFilterSpec(Mergeable, SerializableDataclass): # quoted identifiers later. where_sql: str bind_parameters: SqlBindParameters - linkable_specs: Tuple[LinkableInstanceSpec, ...] linkable_elements: Tuple[LinkableElement, ...] + linkable_spec_set: LinkableSpecSet + + @property + def linkable_specs(self) -> Tuple[LinkableInstanceSpec, ...]: # noqa: D102 + return self.linkable_spec_set.as_tuple def merge(self, other: WhereFilterSpec) -> WhereFilterSpec: # noqa: D102 if self == WhereFilterSpec.empty_instance(): @@ -61,7 +66,7 @@ def merge(self, other: WhereFilterSpec) -> WhereFilterSpec: # noqa: D102 return WhereFilterSpec( where_sql=f"({self.where_sql}) AND ({other.where_sql})", bind_parameters=self.bind_parameters.combine(other.bind_parameters), - linkable_specs=ordered_dedupe(self.linkable_specs, other.linkable_specs), + linkable_spec_set=self.linkable_spec_set.merge(other.linkable_spec_set).dedupe(), linkable_elements=ordered_dedupe(self.linkable_elements, other.linkable_elements), ) @@ -75,6 +80,6 @@ def empty_instance(cls) -> WhereFilterSpec: return WhereFilterSpec( where_sql="TRUE", bind_parameters=SqlBindParameters(), - linkable_specs=(), + linkable_spec_set=LinkableSpecSet(), linkable_elements=(), ) diff --git a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py index 82d862ec41..d23d1da8c3 100644 --- a/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py +++ b/metricflow-semantics/metricflow_semantics/specs/where_filter/where_filter_transform.py @@ -13,6 +13,7 @@ FilterSpecResolutionLookUp, ) from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver +from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet from metricflow_semantics.specs.rendered_spec_tracker import RenderedSpecTracker from metricflow_semantics.specs.where_filter.where_filter_dimension import WhereFilterDimensionFactory from metricflow_semantics.specs.where_filter.where_filter_entity import WhereFilterEntityFactory @@ -108,7 +109,7 @@ def create_from_where_filter_intersection( # noqa: D102 WhereFilterSpec( where_sql=where_sql, bind_parameters=SqlBindParameters(), - linkable_specs=rendered_specs, + linkable_spec_set=LinkableSpecSet.create_from_specs(rendered_specs), linkable_elements=linkable_elements, ) ) diff --git a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py index 8379a47a95..fa48dcb6b2 100644 --- a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py +++ b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py @@ -7,6 +7,7 @@ from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter from metricflow_semantics.filters.time_constraint import TimeRangeConstraint from metricflow_semantics.query.query_parser import MetricFlowQueryParser +from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec from metricflow_semantics.specs.where_filter.where_filter_spec import WhereFilterSpec from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters @@ -76,7 +77,10 @@ def test_branch_state_propagation(branch_state_tracker: PredicatePushdownBranchS original_pushdown_state=base_state, where_filter_specs=( WhereFilterSpec( - where_sql="x is true", bind_parameters=SqlBindParameters(), linkable_elements=(), linkable_specs=() + where_sql="x is true", + bind_parameters=SqlBindParameters(), + linkable_elements=(), + linkable_spec_set=LinkableSpecSet(), ), ), ) @@ -110,10 +114,16 @@ def test_applied_filter_back_propagation(branch_state_tracker: PredicatePushdown """ base_state = branch_state_tracker.last_pushdown_state where_spec_x_is_true = WhereFilterSpec( - where_sql="x is true", bind_parameters=SqlBindParameters(), linkable_elements=(), linkable_specs=() + where_sql="x is true", + bind_parameters=SqlBindParameters(), + linkable_elements=(), + linkable_spec_set=LinkableSpecSet(), ) where_spec_y_is_null = WhereFilterSpec( - where_sql="y is null", bind_parameters=SqlBindParameters(), linkable_elements=(), linkable_specs=() + where_sql="y is null", + bind_parameters=SqlBindParameters(), + linkable_elements=(), + linkable_spec_set=LinkableSpecSet(), ) where_state = PredicatePushdownState.with_where_filter_specs( diff --git a/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py b/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py index 0448d27011..1363328d53 100644 --- a/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py +++ b/tests_metricflow/plan_conversion/test_dataflow_to_sql_plan.py @@ -17,6 +17,7 @@ from metricflow_semantics.specs.column_assoc import ColumnAssociationResolver from metricflow_semantics.specs.dimension_spec import DimensionSpec from metricflow_semantics.specs.entity_spec import LinklessEntitySpec +from metricflow_semantics.specs.linkable_spec_set import LinkableSpecSet from metricflow_semantics.specs.measure_spec import MeasureSpec, MetricInputMeasureSpec from metricflow_semantics.specs.metric_spec import MetricSpec from metricflow_semantics.specs.non_additive_dimension_spec import NonAdditiveDimensionSpec @@ -191,11 +192,13 @@ def test_filter_with_where_constraint_node( WhereFilterSpec( where_sql="booking__ds__day = '2020-01-01'", bind_parameters=SqlBindParameters(), - linkable_specs=( - TimeDimensionSpec( - element_name="ds", - entity_links=(EntityReference(element_name="booking"),), - time_granularity=TimeGranularity.DAY, + linkable_spec_set=LinkableSpecSet( + time_dimension_specs=( + TimeDimensionSpec( + element_name="ds", + entity_links=(EntityReference(element_name="booking"),), + time_granularity=TimeGranularity.DAY, + ), ), ), linkable_elements=( diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml index 790ffe2f20..542d5be751 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan__dfp_0.xml @@ -30,12 +30,6 @@ - - - - - - @@ -52,6 +46,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml index 7077e14d3d..e4eb53ea7e 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_distinct_values_plan_with_join__dfp_0.xml @@ -35,12 +35,6 @@ - - - - - - @@ -57,6 +51,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml index d358d42813..2af5d836a4 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_join_to_time_spine_with_filters__dfp_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -42,28 +47,35 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -89,12 +101,6 @@ - - - - - - @@ -111,6 +117,14 @@ + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml index e10f1637e1..b7316dcade 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_plan__dfp_0.xml @@ -12,50 +12,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -72,12 +78,6 @@ - - - - - - @@ -104,6 +104,18 @@ + + + + + + + + + + + + @@ -177,50 +189,56 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -237,12 +255,6 @@ - - - - - - @@ -269,6 +281,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml index dacb8f92cf..5cae6fe5da 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_measure_constraint_with_reused_measure_plan__dfp_0.xml @@ -12,41 +12,47 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -63,12 +69,6 @@ - - - - - - @@ -85,6 +85,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_metric_where_filter__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_metric_where_filter__dfp_0.xml index d6fdb718ed..010e620781 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_metric_where_filter__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_metric_where_filter__dfp_0.xml @@ -17,20 +17,28 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_query_where_filter__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_query_where_filter__dfp_0.xml index 14829a5c07..b0a31a473c 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_query_where_filter__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_metric_in_query_where_filter__dfp_0.xml @@ -5,27 +5,33 @@ - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -37,20 +43,28 @@ - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml index 99b604df39..83cfb6e9df 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_to_grain_metric_filter_and_query_have_different_granularities__dfp_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -44,12 +49,6 @@ - - - - - - @@ -66,6 +65,14 @@ + + + + + + + + @@ -83,28 +90,35 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml index 9b55aa5c18..8c4815d37b 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_offset_window_metric_filter_and_query_have_different_granularities__dfp_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -47,12 +52,6 @@ - - - - - - @@ -69,6 +68,14 @@ + + + + + + + + @@ -89,12 +96,6 @@ - - - - - - @@ -111,6 +112,14 @@ + + + + + + + + @@ -159,12 +168,6 @@ - - - - - - @@ -181,6 +184,14 @@ + + + + + + + + @@ -200,12 +211,6 @@ - - - - - - @@ -222,6 +227,14 @@ + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml index 97d6aa3a03..467d3bf909 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -44,6 +38,18 @@ + + + + + + + + + + + + @@ -67,12 +73,6 @@ - - - - - - @@ -99,6 +99,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml index a84a4e5acf..c950f9385b 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_plan_time_dimension__dfp_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -50,28 +55,35 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml index c33ea9936a..a6e585715e 100644 --- a/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml +++ b/tests_metricflow/snapshots/test_dataflow_plan_builder.py/DataflowPlan/test_where_constrained_with_common_linkable_plan__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -44,6 +38,18 @@ + + + + + + + + + + + + @@ -57,12 +63,6 @@ - - - - - - @@ -89,6 +89,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml index dafd8266aa..ced298e06e 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -62,12 +68,6 @@ - - - - - - @@ -84,6 +84,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml index cf357d7c00..b0146bac81 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -104,12 +110,6 @@ - - - - - - @@ -130,6 +130,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml index 6776b66cae..f7660b833d 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -58,12 +64,6 @@ - - - - - - @@ -80,6 +80,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml index ba6acad042..353671b14e 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -105,14 +111,6 @@ - - - - - - - - @@ -133,6 +131,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml index 851124deb7..7700fbd293 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -109,12 +121,6 @@ - - - - - - @@ -131,6 +137,18 @@ + + + + + + + + + + + + @@ -222,12 +240,6 @@ - - - - - - @@ -246,6 +258,18 @@ + + + + + + + + + + + + @@ -283,12 +307,6 @@ - - - - - - @@ -305,6 +323,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml index 15ec81da3d..13c15b531d 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -152,16 +164,6 @@ - - - - - - - - - - @@ -182,6 +184,18 @@ + + + + + + + + + + + + @@ -230,12 +244,6 @@ - - - - - - @@ -254,6 +262,18 @@ + + + + + + + + + + + + @@ -291,12 +311,6 @@ - - - - - - @@ -313,6 +327,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfp_0.xml index 079fa45fed..da8700c14b 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84,12 +96,6 @@ - - - - - - @@ -106,6 +112,18 @@ + + + + + + + + + + + + @@ -128,12 +146,6 @@ - - - - - - @@ -150,6 +162,18 @@ + + + + + + + + + + + + @@ -241,12 +265,6 @@ - - - - - - @@ -265,6 +283,18 @@ + + + + + + + + + + + + @@ -277,12 +307,6 @@ - - - - - - @@ -299,6 +323,18 @@ + + + + + + + + + + + + @@ -321,12 +357,6 @@ - - - - - - @@ -343,6 +373,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfpo_0.xml index a63d20297c..a86e08210b 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -84,12 +96,6 @@ - - - - - - @@ -106,6 +112,18 @@ + + + + + + + + + + + + @@ -171,16 +189,6 @@ - - - - - - - - - - @@ -201,6 +209,18 @@ + + + + + + + + + + + + @@ -249,12 +269,6 @@ - - - - - - @@ -273,6 +287,18 @@ + + + + + + + + + + + + @@ -285,12 +311,6 @@ - - - - - - @@ -307,6 +327,18 @@ + + + + + + + + + + + + @@ -329,12 +361,6 @@ - - - - - - @@ -351,6 +377,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml index 61a732e4bc..e2717cf4a6 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -99,12 +111,6 @@ - - - - - - @@ -121,6 +127,18 @@ + + + + + + + + + + + + @@ -211,12 +229,6 @@ - - - - - - @@ -235,6 +247,18 @@ + + + + + + + + + + + + @@ -262,12 +286,6 @@ - - - - - - @@ -284,6 +302,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml index 6e0d5568ef..f98353aaa3 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -43,40 +49,46 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -141,16 +153,6 @@ - - - - - - - - - - @@ -171,6 +173,18 @@ + + + + + + + + + + + + @@ -217,12 +231,6 @@ - - - - - - @@ -241,6 +249,18 @@ + + + + + + + + + + + + @@ -268,12 +288,6 @@ - - - - - - @@ -290,6 +304,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml index 00ef1cf58a..654b0fdff1 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -57,12 +63,6 @@ - - - - - - @@ -79,6 +79,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml index b7d660433e..749a3094f5 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml @@ -12,12 +12,6 @@ - - - - - - @@ -34,6 +28,18 @@ + + + + + + + + + + + + @@ -93,12 +99,6 @@ - - - - - - @@ -115,6 +115,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml index c5d93e64db..5f2249ddf6 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -50,28 +55,35 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml index 78a2110fea..8d1a057c86 100644 --- a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml @@ -5,35 +5,40 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -50,28 +55,35 @@ - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml b/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml index 25dd48aa97..0aaf6df1f0 100644 --- a/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml +++ b/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfp_0.xml @@ -51,12 +51,6 @@ - - - - - - @@ -73,6 +67,18 @@ + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml b/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml index c85ce86aca..2e687c4068 100644 --- a/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml +++ b/tests_metricflow/snapshots/test_source_scan_optimizer.py/DataflowPlan/test_constrained_metric_not_combined__dfpo_0.xml @@ -51,12 +51,6 @@ - - - - - - @@ -73,6 +67,18 @@ + + + + + + + + + + + +