Skip to content

Fix grouping of comment-separated identifiers - #903

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

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)

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

1 participant