Skip to content

Query order argument incorrectly uses a string as an iterable type.  #887

@theacodes

Description

@theacodes

When querying an empty dataset that is empty with a sort order, for example:

query = datastore.Query(kind='Book', order='title')
it = query.fetch(limit=limit, start_cursor=cursor)
entities, more_results, cursor = it.next_page()

It raises an exception:

PreconditionFailed: 412 no matching index found.

Once you create an entity in the dataset, the error disappears. It reappears when you delete all entities.

gcloud-node doesn't suffer from the same problem, as this just returns an empty array for an empty dataset:

var q = ds.createQuery([kind])
      .limit(limit)
      .order('title')
      .start(token);

Metadata

Metadata

Assignees

Labels

api: datastoreIssues related to the Datastore API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions