Skip to content

Require comma separators between function arguments - #384

Draft
srijan2607 wants to merge 1 commit into
jmespath:developfrom
srijan2607:fix/function-argument-separators-reissue
Draft

srijan2607 wants to merge 1 commit into
jmespath:developfrom
srijan2607:fix/function-argument-separators-reissue

Conversation

@srijan2607

@srijan2607 srijan2607 commented Oct 15, 2026 •

Copy link
Copy Markdown

The parser accepts missing argument commas (contains(@ @)) and trailing commas (length(@,)), although neither is valid function-call syntax.

Require a comma before another argument and an expression after each comma. Preserve empty calls and valid nested calls, multiselects and expression references. Add regression tests for missing/trailing commas and positive controls for valid argument lists.

Validation on Python 3.11.2:

  • Original implementation: 2 new regression methods fail, 1 positive-control method passes; all 8 malformed examples were previously accepted.
  • Parser suite: 45 passed.
  • Full suite: 994 passed, 1 skipped (Python 2-only long() test), 22 existing deprecated-literal warnings.
  • git diff --check passed.

Backward compatibility

Comma-less function calls such as contains(@ @) currently parse in jmespath.py, go-jmespath and jmespath.js. They will raise a parse error in jmespath.py after this change. Existing botocore or AWS CLI --query expressions that rely on that permissive syntax may need commas added. Valid comma-separated calls are unchanged.

Implemented and tested with AI assistance; independently reviewed by a separate AI agent. Pending Srijan's human review; not submitted upstream.
@srijan2607

Copy link
Copy Markdown
Author

@jamesls could you approve the pending GitHub Actions runs for this PR when appropriate? At head 9ac1905ac345, both workflows are waiting for approval with zero jobs executed. CI is not yet verified.

@srijan2607

Copy link
Copy Markdown
Author

@jamesls, following up on my earlier request: could you approve the pending workflow for this function-argument comma separator fix when convenient? Please let me know if anything is needed from my side.

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.

1 participant