Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SFN] Support for JsonPath Regexes #9942

Merged
merged 12 commits into from
Feb 19, 2024
Merged

[SFN] Support for JsonPath Regexes #9942

merged 12 commits into from
Feb 19, 2024

Conversation

MEPalma
Copy link
Contributor

@MEPalma MEPalma commented Dec 26, 2023

Motivation

Currently the SFN v2 provider incorrectly parses json path strings especially when filtering options. Furthermore, the non extended version of jsonpath_ng parser is used. The PR simplified the parsing of json path definitions and delegates them all as a complete string to jsonpath_ng. The PR also resolves some issue with returning single objects or list of objects in some json path accesses.
However, currently, the jsonpath_ng is not always able to adhere to spec h2non/jsonpath-ng#8. This issue should be followed in the future, and the tests added in this PR enabled for filtering json path definitions. Addresses and stales: #9937

Changes

  • updated the intrinsic lexer and parser to bind any json path definition to a single token
  • updated the json path access logic to use jsonpath_ng ext parser
  • updated the json path access logic to more consistently return single objects or list of objects depending on the json path definition
  • adds relevant tests

@MEPalma MEPalma added the semver: patch Non-breaking changes which can be included in patch releases label Dec 26, 2023
@MEPalma MEPalma self-assigned this Dec 26, 2023
@MEPalma MEPalma marked this pull request as ready for review January 8, 2024 13:06
@MEPalma MEPalma added this to the 3.1 milestone Jan 8, 2024
@MEPalma MEPalma linked an issue Jan 8, 2024 that may be closed by this pull request
1 task
Copy link

github-actions bot commented Jan 8, 2024

LocalStack Community integration with Pro

    2 files  ±0      2 suites  ±0   1h 26m 41s ⏱️ + 5m 7s
2 644 tests +2  2 396 ✅ +1  248 💤 +1  0 ❌ ±0 
2 646 runs  +2  2 396 ✅ +1  250 💤 +1  0 ❌ ±0 

Results for commit 46a654e. ± Comparison against base commit b558f3a.

♻️ This comment has been updated with latest results.

@coveralls
Copy link

coveralls commented Jan 17, 2024

Coverage Status

coverage: 83.857% (-0.008%) from 83.865%
when pulling 46a654e on MEP-sfn-jsonpath-regex
into b558f3a on master.

@MEPalma MEPalma removed this from the 3.1 milestone Jan 23, 2024
@phildunphytoo
Copy link

I would love to see this merged :)

Copy link
Member

@dominikschubert dominikschubert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🚀

I'd be curious to see at some point what subset of jsonpath stepfunctions on AWS supports, but I guess for now just depending on jsonpath_ng and its support should be fine for most use cases. 👍

@MEPalma MEPalma added this to the 3.2 milestone Feb 19, 2024
@MEPalma MEPalma merged commit 0967cae into master Feb 19, 2024
27 checks passed
@MEPalma MEPalma deleted the MEP-sfn-jsonpath-regex branch February 19, 2024 14:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
semver: patch Non-breaking changes which can be included in patch releases
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: StepFunction with JMESPath yields "Unexpected character"
4 participants