Skip to content

recursive select calls are parsed with bad trailing_commas parameter #1521

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

Merged
merged 1 commit into from
Nov 23, 2024

Conversation

tomershaniii
Copy link
Contributor

@tomershaniii tomershaniii commented Nov 13, 2024

The parse_projection function modifies the parsers 'options' flag, this creates different behavior when nesting select calls i.e. select(select()) which can manifest in failure to parse (see unit test)

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

Thanks @tomershaniii! Left some comments, I think the changes look reasonable overall

@tomershaniii tomershaniii force-pushed the main branch 2 times, most recently from a93ba22 to f5ec87b Compare November 17, 2024 07:15
@tomershaniii
Copy link
Contributor Author

Thanks for the review @iffyio, changes committed per your suggestions

@tomershaniii tomershaniii force-pushed the main branch 3 times, most recently from 1d1547e to 2f70699 Compare November 17, 2024 14:20
@tomershaniii
Copy link
Contributor Author

With tests fixed. @iffyio

Copy link
Contributor

@iffyio iffyio left a comment

Choose a reason for hiding this comment

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

LGTM! cc @alamb

Copy link
Contributor

@alamb alamb left a comment

Choose a reason for hiding this comment

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

Thank you @tomershaniii and @iffyio


let ret = self.parse_comma_separated(|p| p.parse_select_item());
self.options.trailing_commas = old_value;
let trailing_commas =
Copy link
Contributor

Choose a reason for hiding this comment

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

this is a nice improvement

@alamb alamb merged commit 1051900 into apache:main Nov 23, 2024
8 checks passed
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