Feat: correctly handle the generation of VALUES expressions using macros#4975
Merged
georgesittas merged 1 commit intomainfrom Jul 16, 2025
Merged
Feat: correctly handle the generation of VALUES expressions using macros#4975georgesittas merged 1 commit intomainfrom
georgesittas merged 1 commit intomainfrom
Conversation
themisvaltinos
approved these changes
Jul 16, 2025
| # intention was to construct a row or a column with the VALUES expression. To avoid this, we | ||
| # amend the AST such that the Tuple is replaced by the macro function call itself. | ||
| expr = self.__parse_value() # type: ignore | ||
| if expr and not wrapped and isinstance(seq_get(expr.expressions, 0), MacroFunc): |
Contributor
There was a problem hiding this comment.
lgtm. I imagine this preserves any other functionality and in this first position it should be each always this macro function?
Contributor
Author
There was a problem hiding this comment.
It doesn't have to be @EACH– other macro functions could also return lists. In that case, we should interpret the items in the list as either columns or rows depending on the presence of the parentheses after VALUES.
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.
This PR aims to address a feature gap. This is the behavior in main today:
Notice how both inputs result in the same output, which produces a single row with three columns. There is no obvious way to produce three columns, using
@EACH, due to how theVALUESparsing works today.