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

remove pin on jsonpath-ng and fix issue #2

Merged
merged 1 commit into from
Feb 12, 2024
Merged

Conversation

bentsku
Copy link
Contributor

@bentsku bentsku commented Feb 9, 2024

We had to pin jsonpath-ng to 1.5.3 following an update from the library. The following line from the change log is responsible:

  • Enclose field names containing literals in quotes

Basically, the matched path was returned with quotes when accessing from match.full_path or match.path, which lead to issue in matching.
We manually remove the ' from the field in order to have the same behavior as before.

Example from test_dot_in_skip_verification_path:
Skipped paths: ["$..aab", "$..b.'a.aa'"]
Matching the fields for "$..b.'a.aa'"
Before the fix:

  • 1.5.3 / match full path = key_a.b.a.aa / return value from build_full_path_nodes = ["key_a", "b", "a.aa"]
  • >1.6 / match full path = key_a.b.'a.aa' / return value from build_full_path_nodes = ["key_a", "b", "'a.aa'"]

I believe we now could also use a regex instead of the whole build_full_path_nodes, which would basically split on . not being enclosed in ', but my regex knowledge is lacking 😬

This simple fix will allow us to unpin for now.

@bentsku bentsku self-assigned this Feb 9, 2024
@bentsku bentsku added the bug Something isn't working label Feb 9, 2024
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, thanks for unpinning 🥳

@bentsku
Copy link
Contributor Author

bentsku commented Feb 9, 2024

How do we proceed for this library? Do we need to update the version, anything to release so that it's effective in your PR?

@bentsku
Copy link
Contributor Author

bentsku commented Feb 9, 2024

(tests were green in community with the fix and the unpinned dependency btw: localstack/localstack#10213)

@alexrashed
Copy link
Member

alexrashed commented Feb 9, 2024

Imho there's no hurry to get this in a release. We can just remove the upper version pin in localstack-core with localstack/localstack#10164.
Then we don't have the pin in localstack-core anymore, and once this PR is contained in a release, the locks will be updated.
Thanks a lot for helping to clean up the dependencies and fixing this incompatibility! This is awesome and will help us to get to a smoother, more predictable, but still effective process of updating our dependencies!

@dominikschubert dominikschubert merged commit 514cb78 into main Feb 12, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants