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

Bug fix: Generate correct instances for JoinOnEntitiesNode #1499

Merged
merged 10 commits into from
Nov 5, 2024

Conversation

courtneyholcomb
Copy link
Contributor

@courtneyholcomb courtneyholcomb commented Nov 2, 2024

There is an internal bug in the dataflow to SQL logic for the JoinOnEntitiesNode that does not appear to impact production, but does impact work I'm doing up the stack. The instances generated in the node contained column associations that were not correct. They referenced the old column associations (from the parent dataset), which did not include the entity links that were added in this node. These incorrect column associations did not appear to be used for anything, and the select columns were generated from the specs instead (which is correct), so that's why this bug flew under the radar.

This PR removes the logic that was causing the bug (the AddLinkToLinkableElements instance converter). Instead, it adds logic to loop through the parent instances and build new instances & select columns simultaneously.

This change left a lot of boilerplate & duplicate code in the function, so I moved a lot of that out to helpers for the instances and specs.

This also adds a lot of simplification for the JoinOnEntitiesNode. It's one of our oldest nodes and was quite verbose.

I recommend reviewing by commit. The snapshot changes are primarily changes to the column order and some node identifiers. There should be no actual behavior changes here.

@courtneyholcomb courtneyholcomb force-pushed the court/filter-less branch 4 times, most recently from b1ccb3b to f5c1eff Compare November 2, 2024 15:22
@courtneyholcomb courtneyholcomb changed the title Court/filter less Bug fix: Generate correct columns for JoinOnEntitiesNode Nov 2, 2024
@dbt-labs dbt-labs deleted a comment from github-actions bot Nov 2, 2024
@courtneyholcomb courtneyholcomb changed the title Bug fix: Generate correct columns for JoinOnEntitiesNode Bug fix: Generate correct columns for JoinOnEntitiesNode Nov 2, 2024
@courtneyholcomb courtneyholcomb marked this pull request as ready for review November 2, 2024 15:39
@courtneyholcomb courtneyholcomb added the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 2, 2024
@courtneyholcomb courtneyholcomb changed the title Bug fix: Generate correct columns for JoinOnEntitiesNode Bug fix: Generate correct instances for JoinOnEntitiesNode Nov 2, 2024
@courtneyholcomb courtneyholcomb added Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment and removed Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment labels Nov 2, 2024
@github-actions github-actions bot removed the Run Tests With Other SQL Engines Runs the test suite against the SQL engines in our target environment label Nov 2, 2024
@courtneyholcomb courtneyholcomb merged commit bfcc13b into main Nov 5, 2024
30 checks passed
@courtneyholcomb courtneyholcomb deleted the court/filter-less branch November 5, 2024 04:10
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