Skip to content

fix(jmespath): handle strings by Unicode code point - #5884

Open
arnavsx3 wants to merge 1 commit into
aws-powertools:mainfrom
arnavsx3:fix/jmespath-unicode
Open

arnavsx3 wants to merge 1 commit into
aws-powertools:mainfrom
arnavsx3:fix/jmespath-unicode

Conversation

@arnavsx3

@arnavsx3 arnavsx3 commented Nov 1, 2026

Copy link
Copy Markdown

Summary

Fixes Unicode handling in JMESPath string functions. For example, length('😀') now returns 1, and reversing a string keeps emoji intact.

Changes

  • Count and reverse strings by code point.
  • Share a code-point comparator across sort(), min(), max(), and their _by() variants.
  • Add tests for supplementary characters, shared prefixes, equal keys, and ordering without normalization.

Validation

The new tests caught 31 failures before the fix. With the fix:

  • All 983 JMESPath tests pass with 100% coverage.
  • Pre-push checks pass, including type checks and all 4,166 unit tests with 100% coverage.
  • JMESPath lint checks and ESM/CommonJS builds pass.

Issue number: closes #5871


By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.

Count and reverse string code points, and share code-point ordering across sort, min/max, and their expression variants. Add public-API regression coverage for supplementary characters, prefixes, stable keys, and normalization-sensitive strings.

Fixes aws-powertools#5871

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L PRs between 100-499 LOC

1 participant