Fix: bug in model creation related to metadata-only statements#4836
Merged
georgesittas merged 1 commit intomainfrom Jul 1, 2025
Merged
Fix: bug in model creation related to metadata-only statements#4836georgesittas merged 1 commit intomainfrom
georgesittas merged 1 commit intomainfrom
Conversation
e0a05b9 to
81b445a
Compare
izeigerman
reviewed
Jun 27, 2025
|
|
||
| jinja_macro_references, used_variables = extract_macro_references_and_variables( | ||
| *(gen(e) for e in statements) | ||
| *(gen(e if isinstance(e, exp.Expression) else e[0]) for e in statements) |
Collaborator
There was a problem hiding this comment.
Are we sure this is a non-breaking change?
Collaborator
Author
There was a problem hiding this comment.
It should be fine, I think. These generated strings are used for extracting macro & variable references. If I'm not mistaken, we'd previously produce "(True, <expression SQL>)" due to reaching this section. After this PR we'll only search <expression SQL>.
izeigerman
approved these changes
Jun 27, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
statementslist can contain pairs of expressions & booleans, which we didn't take into account in the line I changed. It's a very small change targeting an edge case so I didn't feel like it was worth spending much time testing it. It probably wouldn't have crashed anyway, seegensource here.