From 69feadcb58ca1f7ecf0e6392ec404db2d1a8c5a4 Mon Sep 17 00:00:00 2001 From: Thomas Lento Date: Tue, 25 Jun 2024 17:39:32 -0700 Subject: [PATCH] Add direct tests for predicate pushdown optimizer (#1303) This addresses the testing gap around the cases covered by the logic internal to the PredicatePushdownOptimizer. It's rather difficult to hand-construct dataflow plans, so these rely on snapshots of DataflowPlan text output for some carefully selected queries which are known to cover the code paths in question. --- metricflow/dataflow/dataflow_plan.py | 5 + .../optimizer/predicate_pushdown_optimizer.py | 1 - .../test_predicate_pushdown_optimizer.py | 251 ++++++++- ..._join_metric_predicate_pushdown__dfp_0.xml | 491 ++++++++++++++++++ ...join_metric_predicate_pushdown__dfpo_0.xml | 491 ++++++++++++++++++ ...rsion_metric_predicate_pushdown__dfp_0.xml | 292 +++++++++++ ...sion_metric_predicate_pushdown__dfpo_0.xml | 331 ++++++++++++ ...ative_metric_predicate_pushdown__dfp_0.xml | 168 ++++++ ...tive_metric_predicate_pushdown__dfpo_0.xml | 208 ++++++++ ...spine_metric_predicate_pushdown__dfp_0.xml | 409 +++++++++++++++ ...pine_metric_predicate_pushdown__dfpo_0.xml | 448 ++++++++++++++++ ...ost_agg_join_predicate_pushdown__dfp_0.xml | 445 ++++++++++++++++ ...st_agg_join_predicate_pushdown__dfpo_0.xml | 484 +++++++++++++++++ ...ffset_metric_predicate_pushdown__dfp_0.xml | 386 ++++++++++++++ ...fset_metric_predicate_pushdown__dfpo_0.xml | 425 +++++++++++++++ ...imple_join_categorical_pushdown__dfp_0.xml | 155 ++++++ ...mple_join_categorical_pushdown__dfpo_0.xml | 192 +++++++ ..._time_pushdown_with_two_targets__dfp_0.xml | 139 +++++ ...time_pushdown_with_two_targets__dfpo_0.xml | 139 +++++ 19 files changed, 5457 insertions(+), 3 deletions(-) create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml create mode 100644 tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml diff --git a/metricflow/dataflow/dataflow_plan.py b/metricflow/dataflow/dataflow_plan.py index 8b113a5de8..6944a73132 100644 --- a/metricflow/dataflow/dataflow_plan.py +++ b/metricflow/dataflow/dataflow_plan.py @@ -215,6 +215,11 @@ def __init__(self, sink_nodes: Sequence[DataflowPlanNode], plan_id: Optional[Dag def sink_node(self) -> DataflowPlanNode: # noqa: D102 return self._sink_nodes[0] + @property + def node_count(self) -> int: + """Returns the number of nodes in the DataflowPlan.""" + return len(DataflowPlan.__all_nodes_in_subgraph(self.sink_node)) + @staticmethod def __all_nodes_in_subgraph(node: DataflowPlanNode) -> Sequence[DataflowPlanNode]: """Node accessor for retrieving a flattened sequence of all nodes in the subgraph upstream of the input node. diff --git a/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py b/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py index a4b4e0b0cb..aa1de45bcb 100644 --- a/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py +++ b/metricflow/dataflow/optimizer/predicate_pushdown_optimizer.py @@ -405,7 +405,6 @@ def visit_combine_aggregated_outputs_node(self, node: CombineAggregatedOutputsNo handling this scenario at this time. """ self._log_visit_node_type(node) - # TODO: move this "remove where filters" logic into PredicatePushdownState updated_pushdown_state = PredicatePushdownState.without_where_filter_specs( original_pushdown_state=self._predicate_pushdown_tracker.last_pushdown_state, ) diff --git a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py index 73ab080a3f..e32fedcfd6 100644 --- a/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py +++ b/tests_metricflow/dataflow/optimizer/test_predicate_pushdown_optimizer.py @@ -3,11 +3,23 @@ from datetime import datetime import pytest +from _pytest.fixtures import FixtureRequest +from dbt_semantic_interfaces.implementations.filters.where_filter import PydanticWhereFilter from metricflow_semantics.filters.time_constraint import TimeRangeConstraint -from metricflow_semantics.specs.spec_classes import WhereFilterSpec +from metricflow_semantics.query.query_parser import MetricFlowQueryParser +from metricflow_semantics.specs.query_spec import MetricFlowQuerySpec +from metricflow_semantics.specs.spec_classes import ( + WhereFilterSpec, +) from metricflow_semantics.sql.sql_bind_parameters import SqlBindParameters +from metricflow_semantics.test_helpers.config_helpers import MetricFlowTestConfiguration +from metricflow_semantics.test_helpers.snapshot_helpers import assert_plan_snapshot_text_equal -from metricflow.dataflow.optimizer.predicate_pushdown_optimizer import PredicatePushdownBranchStateTracker +from metricflow.dataflow.builder.dataflow_plan_builder import DataflowPlanBuilder +from metricflow.dataflow.optimizer.predicate_pushdown_optimizer import ( + PredicatePushdownBranchStateTracker, + PredicatePushdownOptimizer, +) from metricflow.plan_conversion.node_processor import PredicateInputType, PredicatePushdownState @@ -148,3 +160,238 @@ def test_applied_filter_back_propagation(branch_state_tracker: PredicatePushdown # We expect to propagate back to the initial entry since we only ever want to apply a filter once within a branch assert branch_state_tracker.last_pushdown_state == both_applied_state + + +def _check_optimization( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + dataflow_plan_builder: DataflowPlanBuilder, + query_spec: MetricFlowQuerySpec, + expected_additional_constraint_nodes_in_optimized: int, +) -> None: + dataflow_plan = dataflow_plan_builder.build_plan(query_spec=query_spec) + optimizer = PredicatePushdownOptimizer(node_data_set_resolver=dataflow_plan_builder._node_data_set_resolver) + optimized_plan = optimizer.optimize(dataflow_plan=dataflow_plan) + + for plan in (dataflow_plan, optimized_plan): + assert_plan_snapshot_text_equal( + request=request, + mf_test_configuration=mf_test_configuration, + plan=plan, + plan_snapshot_text=plan.structure_text(), + ) + + assert dataflow_plan.node_count + expected_additional_constraint_nodes_in_optimized == optimized_plan.node_count, ( + f"Did not get the expected number ({expected_additional_constraint_nodes_in_optimized}) of additional " + f"constraint nodes in the optimized plan, found {optimized_plan.node_count - dataflow_plan.node_count} added " + "nodes. Check snapshot output for details." + ) + + +def test_simple_join_categorical_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimization for a simple predicate through a single join.""" + query_spec = query_parser.parse_and_validate_query( + metric_names=("bookings",), + group_by_names=("listing__country_latest",), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('booking__is_instant') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, + ) + + +def test_simple_join_metric_time_pushdown_with_two_targets( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimization for a simple metric time predicate through a single join. + + This includes a scenario where the dimension source is also a metric time node, but we do NOT want the metric_time + filter applied to it since it is a _current style dimension table at its core. + + Note this optimizer will not push the predicate down until metric_time pushdown is supported. + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("bookings",), + group_by_names=("listing__country_latest",), + where_constraint=PydanticWhereFilter(where_sql_template="{{ TimeDimension('metric_time') }} = '2024-01-01'"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=0, # TODO: Add support for time dimension pushdown + ) + + +def test_conversion_metric_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior for a simple predicate on a conversion metric. + + As of this time the pushdown should NOT move past the conversion metric node. + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("visit_buy_conversion_rate_7days",), + group_by_names=("metric_time", "user__home_state_latest"), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('visit__referrer_id') }} = '123456'"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, # TODO: Remove superfluous where constraint nodes + ) + + +def test_cumulative_metric_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior for a query against a cumulative metric. + + At this time categorical dimension predicates should be pushed down, but metric_time predicates should not be, + since supporting time filter pushdown for cumulative metrics requires filter expansion to ensure we capture the + full set of inputs for the initial cumulative window. + + TODO: Add metric time filters + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("every_two_days_bookers",), + group_by_names=("listing__country_latest", "metric_time"), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('booking__is_instant') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, + ) + + +@pytest.mark.skip("plan output has non-deterministic ordering") +def test_aggregate_output_join_metric_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior when a metric does an aggregate output metric join. + + In this case we expect filters to not be pushed down, since they are outside of a full outer join. + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("views_times_booking_value",), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('listing__is_lux_latest') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=0, + ) + + +def test_offset_metric_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior for a query against a derived offset metric. + + As with cumulative metrics, at this time categorical dimension predicates may be pushed down, but metric_time + predicates should not be, since we need to capture the union of the filter window and the offset span. + + TODO: Add metric time filters + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("bookings_growth_2_weeks",), + group_by_names=("listing__country_latest", "metric_time"), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('booking__is_instant') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, + ) + + +def test_fill_nulls_time_spine_metric_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior for a metric with a time spine and fill_nulls_with enabled. + + Until time dimension pushdown is supported we will only see the categorical dimension entry pushed down here. + + TODO: Add metric time filters + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("bookings_growth_2_weeks_fill_nulls_with_0",), + group_by_names=("listing__country_latest", "metric_time"), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('booking__is_instant') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, + ) + + +def test_fill_nulls_time_spine_metric_with_post_agg_join_predicate_pushdown( + request: FixtureRequest, + mf_test_configuration: MetricFlowTestConfiguration, + query_parser: MetricFlowQueryParser, + dataflow_plan_builder: DataflowPlanBuilder, +) -> None: + """Tests pushdown optimizer behavior for a metric with a time spine and fill_nulls_with and a post-agg join. + + When querying a metric like this with a group by on all filter specs we do a post-aggregation outer join + against the time spine, which should preclude predicate pushdown for query-time filters at that state, but + will allow for pushdown within the JoinToTimeSpine operation. This will still do predicate pushdown as before, + but only exactly as before - the added constraint outside of the JoinToTimeSpine operation must still be + applied. + + Until time dimension pushdown is supported we will only see the categorical dimension entry pushed down here. + + TODO: Add metric time filters + """ + query_spec = query_parser.parse_and_validate_query( + metric_names=("bookings_growth_2_weeks_fill_nulls_with_0",), + group_by_names=("listing__country_latest", "booking__is_instant", "metric_time"), + where_constraint=PydanticWhereFilter(where_sql_template="{{ Dimension('booking__is_instant') }}"), + ).query_spec + _check_optimization( + request=request, + mf_test_configuration=mf_test_configuration, + dataflow_plan_builder=dataflow_plan_builder, + query_spec=query_spec, + expected_additional_constraint_nodes_in_optimized=1, + ) diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfp_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfp_0.xml new file mode 100644 index 0000000000..47819ffdbb --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfp_0.xml @@ -0,0 +1,491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfpo_0.xml b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfpo_0.xml new file mode 100644 index 0000000000..e8db2fca59 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_aggregate_output_join_metric_predicate_pushdown__dfpo_0.xml @@ -0,0 +1,491 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..dafd8266aa --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfp_0.xml @@ -0,0 +1,292 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..c8db880883 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_conversion_metric_predicate_pushdown__dfpo_0.xml @@ -0,0 +1,331 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..6776b66cae --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfp_0.xml @@ -0,0 +1,168 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..5825091ab9 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_cumulative_metric_predicate_pushdown__dfpo_0.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..851124deb7 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfp_0.xml @@ -0,0 +1,409 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..1821e2e4e6 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_fill_nulls_time_spine_metric_predicate_pushdown__dfpo_0.xml @@ -0,0 +1,448 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..0ee0ae8bc5 --- /dev/null +++ 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 @@ -0,0 +1,445 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..279c2d2a35 --- /dev/null +++ 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 @@ -0,0 +1,484 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..61a732e4bc --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfp_0.xml @@ -0,0 +1,386 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..8aaee15d84 --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_offset_metric_predicate_pushdown__dfpo_0.xml @@ -0,0 +1,425 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..00ef1cf58a --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfp_0.xml @@ -0,0 +1,155 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..cb9a54f4fe --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_categorical_pushdown__dfpo_0.xml @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..c5d93e64db --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfp_0.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 new file mode 100644 index 0000000000..78a2110fea --- /dev/null +++ b/tests_metricflow/snapshots/test_predicate_pushdown_optimizer.py/DataflowPlan/test_simple_join_metric_time_pushdown_with_two_targets__dfpo_0.xml @@ -0,0 +1,139 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +