Repository navigation
fix(datastore): support IN and NOT_IN operators on __key__ filters - #19076
Merged
daniel-sanche merged 3 commits intoNov 25, 2026
Merged
daniel-sanche merged 3 commits into
daniel-sanche merged 3 commits into
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for filtering on __key__ using the IN and NOT_IN operators with a list of keys, updating the validation logic, protobuf generation, docstrings, and adding corresponding unit and system tests. The review feedback recommends extending this support to accept both list and tuple types for sequence parameters to align with Python idioms, along with updating the relevant docstrings and test cases.
ohmayr
approved these changes
Nov 19, 2026
|
|
||
|
|
||
| @pytest.mark.parametrize("database_id", [None, _helpers.TEST_DATABASE], indirect=True) | ||
| def test_query_key_filter_in(query_client, ancestor_query, database_id): |
Contributor
There was a problem hiding this comment.
Have we verified NOT_IN on __key__ against live Datastore too? If it's supported with ancestor_query, might be nice to cover it here alongside IN.
Contributor
Author
There was a problem hiding this comment.
added a test, thanks
Co-authored-by: ohmayr <omairnaveed@ymail.com>
daniel-sanche
force-pushed
the
fix_datastore_key_in_filter_google-cloud-datastore_15339
branch
from
November 25, 2026 23:15
90293bb to
bee845a
Compare
daniel-sanche
deleted the
fix_datastore_key_in_filter_google-cloud-datastore_15339
branch
November 25, 2026 23:48
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.
Previously, filters against key required a single key, which means IN and NOT_IN oeprators, which depend on a list of keys, would be rejected
This PR extends the validation to allow lists of keys for these operators, while still requiring a single key for others
Fixes #15339