Skip to content

Fix: Parsing of session properties when only one key-value pair is provided#2610

Merged
izeigerman merged 1 commit intomainfrom
fix-session-properties-paren-expr
May 14, 2024
Merged

Fix: Parsing of session properties when only one key-value pair is provided#2610
izeigerman merged 1 commit intomainfrom
fix-session-properties-paren-expr

Conversation

@izeigerman
Copy link
Contributor

Expression

session_properties (
    'warehouse' = 'test_warehouse'
)

is being parsed into the exp.Paren expression instead of exp.Tuple which was not accounted for while merging the model's values with the default ones.

@izeigerman izeigerman requested a review from a team May 14, 2024 22:17
session_properties = {k: exp.Literal.string(k).eq(v) for k, v in provided.items()}
elif provided:
if isinstance(provided, exp.Paren):
provided = exp.Tuple(expressions=[provided.this])
Copy link
Contributor

Choose a reason for hiding this comment

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

provided.this.unnest()

then you can handle many parenthesis lol

@izeigerman izeigerman merged commit 404c68e into main May 14, 2024
@izeigerman izeigerman deleted the fix-session-properties-paren-expr branch May 14, 2024 22:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants