From 66b030a798ff8342e81ceeee5fbaa4db9ec64607 Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Wed, 10 Apr 2024 14:27:20 -0700 Subject: [PATCH] Rename node visitor method to match typical pattern (#1121) --- metricflow/dataflow/dataflow_plan.py | 2 +- metricflow/dataflow/nodes/filter_elements.py | 2 +- metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py | 2 +- .../dataflow/optimizer/source_scan/source_scan_optimizer.py | 2 +- metricflow/plan_conversion/dataflow_to_sql.py | 2 +- .../optimizer/source_scan/test_source_scan_optimizer.py | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/metricflow/dataflow/dataflow_plan.py b/metricflow/dataflow/dataflow_plan.py index d86a7331cc..fcfa0d6b24 100644 --- a/metricflow/dataflow/dataflow_plan.py +++ b/metricflow/dataflow/dataflow_plan.py @@ -127,7 +127,7 @@ def visit_write_to_result_table_node(self, node: WriteToResultTableNode) -> Visi pass @abstractmethod - def visit_pass_elements_filter_node(self, node: FilterElementsNode) -> VisitorOutputT: # noqa: D102 + def visit_filter_elements_node(self, node: FilterElementsNode) -> VisitorOutputT: # noqa: D102 pass @abstractmethod diff --git a/metricflow/dataflow/nodes/filter_elements.py b/metricflow/dataflow/nodes/filter_elements.py index 8853d996e0..aff60197c0 100644 --- a/metricflow/dataflow/nodes/filter_elements.py +++ b/metricflow/dataflow/nodes/filter_elements.py @@ -41,7 +41,7 @@ def distinct(self) -> bool: return self._distinct def accept(self, visitor: DataflowPlanNodeVisitor[VisitorOutputT]) -> VisitorOutputT: # noqa: D102 - return visitor.visit_pass_elements_filter_node(self) + return visitor.visit_filter_elements_node(self) @property def description(self) -> str: # noqa: D102 diff --git a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py index 1bdad26822..d7a9b89a82 100644 --- a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py +++ b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py @@ -338,7 +338,7 @@ def visit_write_to_result_table_node( # noqa: D102 self._log_visit_node_type(node) return self._handle_unsupported_node(node) - def visit_pass_elements_filter_node( # noqa: D102 + def visit_filter_elements_node( # noqa: D102 self, node: FilterElementsNode ) -> ComputeMetricsBranchCombinerResult: # noqa: D102 self._log_visit_node_type(node) diff --git a/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py b/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py index 111e0106bc..6d604e0fbb 100644 --- a/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py +++ b/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py @@ -194,7 +194,7 @@ def visit_write_to_result_table_node(self, node: WriteToResultTableNode) -> Opti self._log_visit_node_type(node) return self._default_sink_node_handler(node) - def visit_pass_elements_filter_node(self, node: FilterElementsNode) -> OptimizeBranchResult: # noqa: D102 + def visit_filter_elements_node(self, node: FilterElementsNode) -> OptimizeBranchResult: # noqa: D102 self._log_visit_node_type(node) return self._default_base_output_handler(node) diff --git a/metricflow/plan_conversion/dataflow_to_sql.py b/metricflow/plan_conversion/dataflow_to_sql.py index a477e332d0..05ff5212e4 100644 --- a/metricflow/plan_conversion/dataflow_to_sql.py +++ b/metricflow/plan_conversion/dataflow_to_sql.py @@ -828,7 +828,7 @@ def visit_write_to_result_table_node(self, node: WriteToResultTableNode) -> SqlD ), ) - def visit_pass_elements_filter_node(self, node: FilterElementsNode) -> SqlDataSet: + def visit_filter_elements_node(self, node: FilterElementsNode) -> SqlDataSet: """Generates the query that realizes the behavior of FilterElementsNode.""" from_data_set: SqlDataSet = node.parent_node.accept(self) output_instance_set = from_data_set.instance_set.transform(FilterElements(node.include_specs)) diff --git a/tests/dataflow/optimizer/source_scan/test_source_scan_optimizer.py b/tests/dataflow/optimizer/source_scan/test_source_scan_optimizer.py index 2ae8165ca2..622fc67eae 100644 --- a/tests/dataflow/optimizer/source_scan/test_source_scan_optimizer.py +++ b/tests/dataflow/optimizer/source_scan/test_source_scan_optimizer.py @@ -78,7 +78,7 @@ def visit_write_to_result_dataframe_node(self, node: WriteToResultDataframeNode) def visit_write_to_result_table_node(self, node: WriteToResultTableNode) -> int: # noqa: D102 return self._sum_parents(node) - def visit_pass_elements_filter_node(self, node: FilterElementsNode) -> int: # noqa: D102 + def visit_filter_elements_node(self, node: FilterElementsNode) -> int: # noqa: D102 return self._sum_parents(node) def visit_combine_aggregated_outputs_node(self, node: CombineAggregatedOutputsNode) -> int: # noqa: D102