docstore/awsdynamodb: don't panic on in/not-in filter over a key field - #3760
Merged
vangent merged 1 commit intoJul 28, 2026
Merged
Conversation
toKeyCondition panicked in its default case when a filter on the partition
or sort key used an op it cannot express as a KeyCondition. docstore's Where()
accepts in/not-in on any field, and bestQueryable picks a Query plan using an
op-agnostic hasFilter check on the sort key, so a valid user query such as
Where("pk","=",x).Where("sk","in",vals) reached that panic and crashed
the calling process. Return false instead so the filter is routed to the
FilterExpression path.
herdiyana256
force-pushed
the
fix-awsdynamodb-key-in-op-panic
branch
from
July 28, 2026 15:00
268debf to
17b65a4
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #3760 +/- ##
==========================================
+ Coverage 75.37% 75.40% +0.02%
==========================================
Files 104 104
Lines 14241 14241
==========================================
+ Hits 10734 10738 +4
+ Misses 2770 2766 -4
Partials 737 737 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
toKeyConditionpanics in its default case when a filter on the partition or sort key uses an operator it cannot express as a DynamoDB KeyCondition. docstore's ownWhere()acceptsin/not-inon any field, andbestQueryableselects a Query plan using an op-agnostichasFiltercheck on the sort key, so a valid user query such asWhere("pk", "=", x).Where("sk", "in", vals)reaches that path. Nothing in the package recovers the panic, so it crashes the calling process during pure-Go query planning, before any network I/O.This returns
falsefrom that case instead, routing the filter to the FilterExpression path rather than panicking. Same class as the empty-in-slice fix in #3754, different code path (toKeyConditionvstoInCondition). Added a regression test coveringinandnot-inon a key field.