-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.
Description
I am trying to query comments that belong to a story.
query = datastore.Query(kind='Comment', filters=[('storyid', '=', 12345)], order=['timestamp'])This code breaks with to following error (I also have additional internal debug info I can share):
gcloud.exceptions.PreconditionFailed: 412 no matching index found.Trying to debug this, I found the following work with no problems:
Removing order
query = datastore.Query(kind='Comment', filters=[('storyid', '=', 12345)])Removing filters
query = datastore.Query(kind='Comment', order=['timestamp'])Changing order to use storyid
query = datastore.Query(kind='Comment', filters=[('storyid', '=', 12345)], order=['storyid'])Why is this happening? The fact that the bottom three queries work and to top one does not is very confusing. Nothing I saw in the documentation indicates that filters and order affect each other.
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.