Skip to content

Handle empty by-function inputs - #65

Open
OskarEichler wants to merge 1 commit into
jmespath:mainfrom
OskarEichler:codex/empty-by-functions
Open

Handle empty by-function inputs#65
OskarEichler wants to merge 1 commit into
jmespath:mainfrom
OskarEichler:codex/empty-by-functions

Conversation

@OskarEichler

Copy link
Copy Markdown

Summary

Return the JMESPath-specified empty results before evaluating by-expression types: [] for sort_by and nil for max_by/min_by.

Reproduction

The current implementation evaluates the expression against a missing first element, then raises an invalid-type error. The latest compliance corpus expects empty results without expression evaluation.

Verification

  • isolated branch: 1,790 examples, zero failures
  • focused empty sort/max/min-by model
  • cumulative candidate: 892 current compliance checks, zero failures
  • all runtime syntax and Rails 8.1.3.1 integration pass

Compatibility

Nonempty inputs and their homogenous-type validation are unchanged. Prepared with AI-assisted source review; no repository tests were changed.

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