From cc64a476d9fb5991075adc67ed5ae3aea28914be Mon Sep 17 00:00:00 2001 From: Courtney Holcomb Date: Mon, 9 Oct 2023 20:19:23 -0700 Subject: [PATCH] Clarify wording --- .../dataflow/builder/dataflow_plan_builder.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/metricflow/dataflow/builder/dataflow_plan_builder.py b/metricflow/dataflow/builder/dataflow_plan_builder.py index d008fcd614..48e3c743a7 100644 --- a/metricflow/dataflow/builder/dataflow_plan_builder.py +++ b/metricflow/dataflow/builder/dataflow_plan_builder.py @@ -559,14 +559,16 @@ def _find_measure_recipe( if len(node_to_evaluation) > 0: # All source nodes cost the same. Find evaluation with lowest number of joins. - node_with_lowest_cost = min(node_to_evaluation, key=lambda node: len(node_to_evaluation[node].join_recipes)) - evaluation = node_to_evaluation[node_with_lowest_cost] + node_with_lowest_cost_plan = min( + node_to_evaluation, key=lambda node: len(node_to_evaluation[node].join_recipes) + ) + evaluation = node_to_evaluation[node_with_lowest_cost_plan] logger.info( - "Lowest cost node is:\n" + "Lowest cost plan is:\n" + pformat_big_objects( - lowest_cost_node=dataflow_dag_as_text(node_with_lowest_cost), + node=dataflow_dag_as_text(node_with_lowest_cost_plan), evaluation=evaluation, - joins=len(node_to_evaluation[node_with_lowest_cost].join_recipes), + joins=len(node_to_evaluation[node_with_lowest_cost_plan].join_recipes), ) ) @@ -584,14 +586,14 @@ def _find_measure_recipe( ) return MeasureRecipe( - measure_node=node_with_lowest_cost, + measure_node=node_with_lowest_cost_plan, required_local_linkable_specs=( evaluation.local_linkable_specs + required_local_entity_specs + required_local_dimension_specs + required_local_time_dimension_specs ), - join_linkable_instances_recipes=node_to_evaluation[node_with_lowest_cost].join_recipes, + join_linkable_instances_recipes=node_to_evaluation[node_with_lowest_cost_plan].join_recipes, ) logger.error("No recipe could be constructed.")