Repository navigation
Conversation
DeepDiff defaults to ignore_private_variables=True, which also skips dict keys starting with "__". Values under keys like "__type" (AWS JSON error type) or GraphQL "__typename" / "__schema" were never verified against the recording. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
bentsku
marked this pull request as ready for review
November 4, 2026 19:39
bentsku
deleted the
aws-2688-localstack-snapshot-keys-starting-with-__-are-never-compared
branch
November 4, 2026 19:39
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
SnapshotMatchResultcompares recorded and observed state withDeepDiff, which defaults toignore_private_variables=True. That setting also skips dict keys starting with__, so any value under such a key was never verified, and snapshot tests passed whatever the response contained there:Affected keys include
__type(the error type in AWS JSON-protocol error responses) and GraphQL__typename/__schema. This came up in AppSync, where an introspection response underdata.__schemadiffered from the AWS recording but the test still passed.Tracked in AWS-2688.
Changes
ignore_private_variables=FalsetoDeepDiffinSnapshotMatchResult.__key mismatches fail (top-level, nested, inside list items), equal__keys pass, andskip_verification_pathssuch as$..__typestill skip them. The four mismatch tests fail without the fix.match_objectis unaffected: it drops keys starting with_itself before diffing.Impact on consumers
Snapshot tests whose
__keys differ from the recording will now fail. Each one is a parity difference that was previously hidden. Fix the provider, add a transformer, or skip the path, e.g.@markers.snapshot.skip_snapshot_verify(paths=["$..__type"]).🤖 Generated with Claude Code