diff --git a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py index 233629e7a..3209e34b8 100644 --- a/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py +++ b/metricflow/dataflow/optimizer/source_scan/cm_branch_combiner.py @@ -133,7 +133,7 @@ def __init__(self, left_branch_node: DataflowPlanNode) -> None: # noqa: D107 self._current_left_node: DataflowPlanNode = left_branch_node def _log_visit_node_type(self, node: DataflowPlanNode) -> None: - logger.debug(lambda: f"Visiting {node.node_id}") + logger.debug(LazyFormat(lambda: f"Visiting {node.node_id}")) def _log_combine_failure( self, diff --git a/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py b/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py index c84035335..95c0aeec3 100644 --- a/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py +++ b/metricflow/dataflow/optimizer/source_scan/source_scan_optimizer.py @@ -280,7 +280,14 @@ def visit_combine_aggregated_outputs_node( # noqa: D102 for branch_combination_result in combination_results ] - logger.debug(lambda: f"Got {len(combined_parent_branches)} branches after combination") + logger.debug( + LazyFormat( + "Possible branches combined.", + count_of_branches_before_combination=len(optimized_parent_branches), + count_of_branches_after_combination=len(combined_parent_branches), + ) + ) + assert len(combined_parent_branches) > 0 # If we were able to reduce the parent branches of the CombineAggregatedOutputsNode into a single one, there's