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

Fix: improve comment handling for several expressions #2017

Merged
merged 2 commits into from
Aug 9, 2023
Merged

Conversation

georgesittas
Copy link
Collaborator

No description provided.

@georgesittas
Copy link
Collaborator Author

georgesittas commented Aug 9, 2023

Making a couple more additions to this...
EDIT: done

@@ -2338,7 +2341,8 @@ def _parse_join(

kwargs["this"].set("joins", joins)

return self.expression(exp.Join, **kwargs)
comments = [c for token in (method, side, kind) if token for c in token.comments]
return self.expression(exp.Join, comments=comments, **kwargs)
Copy link
Owner

Choose a reason for hiding this comment

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

inline as a generator?

comments= ( . ...)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We're going to expand the generator into the full list anyway, right? Will this be beneficial?

Copy link
Owner

Choose a reason for hiding this comment

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

yes because you're creating an extra list here

Copy link
Owner

Choose a reason for hiding this comment

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

ah nvm the type is a list

@tobymao tobymao merged commit baab165 into main Aug 9, 2023
@tobymao tobymao deleted the jo/comment_fixup branch August 9, 2023 20:51
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.

2 participants