Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Align dataflow plans #1511

Merged
merged 1 commit into from
Nov 8, 2024
Merged

Align dataflow plans #1511

merged 1 commit into from
Nov 8, 2024

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Nov 6, 2024

Dedupe logic in the DataflowPlanBuilder. Diverging paths in the dataflow plan have frequently been a source of bugs. To reduce similar future bugs, this PR unifies some of the logic across all paths. There are several steps we always take after source node generation and before aggregation. This PR moves all that logic into a helper function to ensure we always use the same logic.

@cla-bot cla-bot bot added the cla:yes label Nov 6, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Nov 6, 2024
@courtneyholcomb courtneyholcomb force-pushed the court/align-dfp branch 2 times, most recently from c2eec4f to fbc9c9f Compare November 8, 2024 02:09
@@ -328,34 +328,23 @@ def _build_aggregated_conversion_node(
)

# Build the unaggregated base measure node for computing conversions
unaggregated_base_measure_node = base_measure_recipe.source_node
if base_measure_recipe.join_targets:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are a few snapshot changes here, and this is the source of those changes. When we call join_targets, it creates a FilterElementsNode under the hood, even if we don't use it. On this line, we call join_targets without using the node that gets generated. The new code only calls join_targets once and uses the generated node, so there the source node IDs are incremented fewer times.
This is true for the other parts of the code referencing join_targets in this PR, too.

@courtneyholcomb courtneyholcomb marked this pull request as ready for review November 8, 2024 02:29
@courtneyholcomb courtneyholcomb merged commit 62aa3e8 into main Nov 8, 2024
16 checks passed
@courtneyholcomb courtneyholcomb deleted the court/align-dfp branch November 8, 2024 03:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants