Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Thanks for contributing!
Before submitting your pull request please have a look at the
following checklist:
pytest)ruff)In addition, please take care to provide a proper description
on what your change does, fixes or achieves when submitting the
pull request.
Fixes #781.
SELECT EXTRACT(YEAR FROM foo) year, EXTRACT(MONTH FROM foo) month, value FROM ordersnow produces one projection list withyearandmonthaliases. Previously the aliases split the projection into separate groups andget_alias()did not return them.Recognize the six date-part keywords only after a bare function at a SELECT-item boundary, with a following projection or clause boundary. Keep interval constructors and their units intact, including
INTERVAL (ABS(-1)) DAY; quoted function names remain distinguishable. The tests also cover scalar-literal predecessors, explicit aliases, nested SELECTs, window functions and JOIN/UNION clauses.This is a bounded grouping fix. Unknown clause keywords stop recognition; comment-separated aliases and broader keyword-alias grammar remain outside its scope.
On Python 3.13.0, the full suite reports 555 passed, 2 expected failures and 1 unexpected pass; the expected-failure statuses match upstream. Against the original source, 40 alias regression cases fail, and an additional formatter regression reproduces the excessive indentation in #781.
ruff check sqlparse/passes. The repository's grouping benchmarks and a function-alias projection benchmark report linear scaling. The other Python/OS combinations are left to hosted CI.Note: This repository has automated AI code reviews enabled to help catch
potential issues early and provide suggestions. This is an experimental
feature to support maintainers and contributors – your feedback is welcome!