Skip to content

Fix grouping of comment-separated identifiers - #903

Closed
banlor wants to merge 1 commit into
andialbrecht:masterfrom
banlor:fix/comment-separated-identifiers
Closed

banlor wants to merge 1 commit into
andialbrecht:masterfrom
banlor:fix/comment-separated-identifiers

Conversation

@banlor

@banlor banlor commented Sep 15, 2026

Copy link
Copy Markdown

Fixes #712.

Keep comments inside qualified identifiers and aliases so a /*c*/ . b AS /*d*/ c parses as one Identifier, without changing the SQL text. Name lookup skips comments and distinguishes an implicit alias from an operand after ., -> or ->>.

Also avoid inserting a duplicate space when stripping comments from the grouped identifier. Tests cover the reported query, quoted and indexed names, newline aliases, and comments around JSON operators.

  • ran the tests (pytest, Python 3.10 through 3.14)
  • all style issues addressed (ruff)
  • your changes are covered by tests
  • your changes are documented, if needed (no new API or options)

@banlor

banlor commented Sep 23, 2026

Copy link
Copy Markdown
Author

@andialbrecht could you review this and #905? Both fixes are waiting for workflow approval.

@banlor

banlor commented Oct 14, 2026

Copy link
Copy Markdown
Author

@andialbrecht the workflows on this PR and #905 are still waiting for approval, so CI hasn't run on either. Could you approve them when you have a moment?

@banlor

banlor commented Oct 28, 2026

Copy link
Copy Markdown
Author

@andialbrecht the workflows here and on #905 still need approval before CI can run. I can rebase either one if that helps.

Signed-off-by: Mikhail Basov <michael.s.basov@gmail.com>
@banlor
banlor force-pushed the fix/comment-separated-identifiers branch from 18e94f8 to 933d267 Compare November 29, 2026 19:16

Copy link
Copy Markdown
Owner

Thanks so much for this PR, and sorry it never got merged!

I've decided to stop maintaining sqlparse, and 0.6.1 was the last release. So I'm closing all open pull requests. That's not because of your work, I just won't be merging or releasing anything anymore. If you're curious why: #945

Thanks again for caring about sqlparse! ❤️


Generated by Claude Code

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.

Incorrect grouping for Identifiers

2 participants