Preserve single grouped expressions in function parameters - #889
Open
emme1t wants to merge 1 commit into
Open
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.
Function.get_parameters()returns an empty list for single expression arguments such asabs(1 + 2),abs((1 + 2)),abs(CASE WHEN 1 THEN 2 ELSE 3 END), andabs(1 = 2).These arguments have already been grouped into
Operation,Parenthesis,Case, andComparisonnodes. Include those node types in the existing single-argument collection path. The regression tests verify that each complete argument is returned as one node with its original text and type.Validation on Windows with Python 3.13.13:
test_issue484_comments_and_newlines.ruff check sqlparseandgit diff --checkpass.abs()function; they return 3, 3, 2, and 0 respectively. The parsed argument lists now contain the corresponding single expressions.OpenAI Codex assisted with the source review, implementation, regression tests, and this description. The reported tests and SQLite checks were executed locally.