-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Removing datastore key query filter restriction. #918
Conversation
Also checking in `Query` constructor that all the filters are valid. Fixes googleapis#917.
Yes, key inequalities are allowed. |
@pcostell does the API allow arbitrary rich comparisons on keys ( |
from gcloud.datastore.key import Key | ||
_DATASET = 'DATASET' | ||
key = Key('Foo', dataset_id='DATASET') | ||
query = self._makeOne(dataset_id=_DATASET) | ||
self.assertRaises(ValueError, query.add_filter, '__key__', '<', key) | ||
query.add_filter('__key__', '<', key) | ||
self.assertEqual(query.filters, [('__key__', '<', key)]) |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
I see that @vinays uses |
Yes I mean |
@pcostell OK, thanks. For future reference, I found the docs for key filters which describe those semantics (but not as clearly as you did :). |
@dhermes LGTM |
Removing datastore key query filter restriction.
Also checking in
Query
constructor that all the filters are valid.Fixes #917.
@pcostell Can you verify that key inequality filters work? (The docs clearly state they do, just want to be careful.) This has been in the codebase longer than I've been working on the project, so maybe it was introduced before inequality filters were allowed?