Skip to content

Keep parenthesized expressions in identifier lists - #932

Closed
adenzhou1350 wants to merge 2 commits into
andialbrecht:masterfrom
adenzhou1350:codex/group-parenthesized-list-expressions
Closed

adenzhou1350 wants to merge 2 commits into
andialbrecht:masterfrom
adenzhou1350:codex/group-parenthesized-list-expressions

Conversation

@adenzhou1350

@adenzhou1350 adenzhou1350 commented Oct 11, 2026 •

Copy link
Copy Markdown

Fixes #343.

Bare parenthesized expressions break a comma-separated identifier list. For example, SELECT a, b, (a-b) FROM bla groups only a, b, leaving the last expression on the wrong line after reindent.

Accept parenthesized list items and group VALUES before identifier lists, keeping each top-level VALUES row separate. Expressions inside those rows still form their own lists.

Tests cover first/middle/last items, adjacent and nested parentheses, scalar subqueries, reindent output and VALUES row boundaries. The original 12 new cases had 11 failures before the fix; those original before/after results remain historical.

Current refresh — November 2

Merged upstream master at 09dbe1eec31e into signed-off head 13d1eca56265. The only manual conflict was CHANGELOG. Keep the upstream file byte-for-byte and drop this PR's unreleased entry, so an unmerged fix is not described as part of the already published final 0.6.1 release. The original production and test added/removed lines are unchanged; the PR now touches three files.

Fresh native Windows Python 3.14, using the repository's uv dev environment and with third-party pytest plugin autoload disabled:

  • Full suite: 549 passed, 2 xfailed, 1 xpassed.
  • Repository-configured ruff check sqlparse/ and scoped git diff --check pass.
  • The two test files are excluded by the repository Ruff configuration. An additional forced check reports 35 diagnostics on both pinned upstream and this candidate, with identical code/message/source-line multisets; no new test diagnostics were introduced.
  • Source hashes and the tested tree were verified unchanged through the pushed merge commit.

The earlier Python 3.12/3.14 518-pass run and wide-column linear-scaling measurements belong to the prior head; they were not rerun as current-head evidence. Linux/macOS and other Python versions remain for hosted CI. Current-head CI is pending.

Upstream maintenance status

Upstream's final 0.6.1 release announces the end of active development/maintenance and that no further releases, including security fixes, are planned. The repository is currently not archived. This refresh preserves that announcement and does not imply a planned upstream release; whether this proposal is accepted remains the maintainer's decision.

AI-assisted implementation and validation.

@adenzhou1350

Copy link
Copy Markdown
Author

Closing this proposal following the maintainer's final 0.6.1 release and end-of-maintenance announcement. Since no further upstream releases are planned, I am withdrawing my pending contribution. The fork branch and existing validation remain available; no further review or CI action is requested. Thank you for maintaining sqlparse.

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.

Inconsistent treatment of IdentifierList

1 participant