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

bug: StepFunction with JMESPath yields "Unexpected character" #9937

Closed
1 task done
phildunphytoo opened this issue Dec 24, 2023 · 5 comments · Fixed by #9942
Closed
1 task done

bug: StepFunction with JMESPath yields "Unexpected character" #9937

phildunphytoo opened this issue Dec 24, 2023 · 5 comments · Fixed by #9942
Assignees
Labels
aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on type: bug Bug report

Comments

@phildunphytoo
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When running a step function that includes a ResultSelector with this json:

{
  "FailedTasks.$": "$[?(@.Status != '201')]"
}

Localstack fails with error:

Exception=JsonPathLexerError, Details=['Error on line 1, col 2: Unexpected character: ? '] ...

Expected Behavior

Expected behaviour as in AWS
(Specifically here: the following should check if any of the results contains a status that's not '201')

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

Run localstack with docker-compose
Create the step function with a map and ResultSelector as described
Run the step function and see it fail :(

Environment

- OS:Rhel 8.6
- LocalStack: 3.0

Anything else?

No response

@phildunphytoo phildunphytoo added status: triage needed Requires evaluation by maintainers type: bug Bug report labels Dec 24, 2023
@phildunphytoo
Copy link
Author

I found this: h2non/jsonpath-ng#8
It could be related

@phildunphytoo
Copy link
Author

The same in 3.0.3

@phildunphytoo
Copy link
Author

Thanks! Waiting for the release :)

@MarcelStranak MarcelStranak added aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on and removed status: triage needed Requires evaluation by maintainers labels Dec 29, 2023
@MEPalma MEPalma linked a pull request Jan 8, 2024 that will close this issue
@MEPalma
Copy link
Contributor

MEPalma commented Feb 19, 2024

The StepFunctions interpreter now correctly delegates to the jsonpath library, which resolves several issues related to parsing and accessing JSON path definitions. However, it's important to note that the jsonpath_ng library doesn't always adhere completely to the spec (as discussed in h2non/jsonpath-ng#8).

Considering this, I am staling this issue for now. Going forward, I will keep an eye on the progress of h2non/jsonpath-ng#8 to ensure alignment with the specifications. Additionally, the tests added in this PR will remain enabled for filtering JSON path definitions.

Feel free to reopen this issue or raise any further concerns if needed. Thank you again for your contribution!

@phildunphytoo
Copy link
Author

Hi, I'm testing this in localstack 3.3 but it seems it doesn't work right.
I have a condition: "$[?(@.Status != '200')]" and it catches outputs that have Status = 200.. Any ideas?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
aws:stepfunctions AWS Step Functions status: backlog Triaged but not yet being worked on type: bug Bug report
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants