Skip to content

Commit

Permalink
Better handling for group by source nodes in ComputeMetricsBranchComb…
Browse files Browse the repository at this point in the history
…iner
  • Loading branch information
courtneyholcomb committed May 15, 2024
1 parent 5357c8e commit 286da20
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -293,6 +293,14 @@ def visit_compute_metrics_node(self, node: ComputeMetricsNode) -> ComputeMetrics
)
return ComputeMetricsBranchCombinerResult()

if self._current_left_node.for_group_by_source_node != current_right_node.for_group_by_source_node:
self._log_combine_failure(
left_node=self._current_left_node,
right_node=current_right_node,
combine_failure_reason="one node is a group by metric source node",
)
return ComputeMetricsBranchCombinerResult()

assert len(combined_parent_nodes) == 1
combined_parent_node = combined_parent_nodes[0]
assert combined_parent_node is not None
Expand All @@ -308,6 +316,7 @@ def visit_compute_metrics_node(self, node: ComputeMetricsNode) -> ComputeMetrics
parent_node=combined_parent_node,
metric_specs=unique_metric_specs,
aggregated_to_elements=current_right_node.aggregated_to_elements,
for_group_by_source_node=current_right_node.for_group_by_source_node,
)
self._log_combine_success(
left_node=self._current_left_node,
Expand Down

0 comments on commit 286da20

Please sign in to comment.