Repository navigation
Conversation
Skip verification paths were applied by rebuilding the matched path from `str(datum.path)`. jsonpath-ng 1.8 quotes many more field names when serializing (spaces, digits-only, unicode, `%`, ...), so intermediate nodes no longer resolved and the skip was silently not applied. Keys with `.` or `:` were already broken before. Instead, mutate the parent container referenced by the match context directly, using the structured `Fields.fields` / `Index.indices` attributes. Require jsonpath-ng>=1.9, which drops Python 3.10 support. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bentsku
marked this pull request as draft
October 7, 2026 23:09
bentsku
added this pull request to stack #29
October 7, 2026 23:09
bentsku
removed this pull request from stack #29
October 7, 2026 23:15
Skipping mutates the recorded and observed state, so assertions running after a successful skip on the same session passed regardless of their skip paths. This hid that dot-notation list indices like `$..aaa.1` never matched: they are not valid JSONPath and are parsed by jsonpath-ng as dict keys. Remove those cases instead of supporting a non-standard notation. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bentsku
marked this pull request as ready for review
October 8, 2026 15:01
Merged
bentsku
added this pull request to stack #31
October 8, 2026 15:05
dominikschubert
approved these changes
Oct 12, 2026
dominikschubert
left a comment
Member
There was a problem hiding this comment.
Looks good. Good catch on the (non-failing) tests 👍
Code was only skimmed, but no concerns from my side otherwise. An expansion of the tested python versions for more modern versions could be a follow-up at some point.
Contributor
Author
Ah, good catch, missed we were not testing 3.13, but might be worth even testing ahead! Will open one today 👍 |
bentsku
deleted the
aws-819-unpin-jsonpath-ngand-upgrade-to-18-by-making-localstack
branch
October 13, 2026 15:31
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
Part of AWS-819. LocalStack pinned
jsonpath-ng==1.7.0in localstack/localstack#13875. This PR makeslocalstack-snapshotwork correctly with jsonpath-ng 1.9+.Skip verification paths were applied by rebuilding the path of each match from
str(datum.path), and only the last node had its quotes stripped. Since 1.8, jsonpath-ng quotes many more field names when serializing (spaces, digits-only,%, unicode, ...). Intermediate nodes with such keys no longer resolved, so the skip was silently not applied and tests failed with spurious snapshot diffs. Keys containing.or:(e.g.aws:SourceArn) were already broken before 1.8.Changes
m.context.value), using the structuredFields.fields/Index.indicesattributes instead of string parsing.jsonpath-ng>=1.9. 1.9 drops Python 3.10, sorequires-pythonis now>=3.11. The 3.10 classifier, CI matrix entry and ruff target are updated to match.$..aaa.1,$..aaa..0) never matched anything on any jsonpath-ng version:.1isn't valid JSONPath (RFC 9535 requires[1]for indices), and jsonpath-ng parses it as a dict key. No skip path in localstack uses this notation, so those cases are removed rather than supported (see Support dot notation for list indices in skip verification paths #28).The next release should be
0.4.0, as it drops Python 3.10.🤖 Generated with Claude Code