-
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
This bug manifests itself in a couple of "fun" ways:
len(list(client.query(kind="Foo").fetch(limit=300)))
Will yield 300
, assuming there are 300
or more entities of that kind.
len(list(client.query(kind="Foo").fetch(limit=500)))
Assuming there are 500
entities of that kind, will yield 500
. If there are n
entities where n > 500
, it will yield n
.
This all seems to be caused by the v1beta3
api truncating the limits to 300
:
entities, more, cursor = client.query(kind="Foo").fetch(limit=500).next_page()
len(entities)
will be 300
and not 500
even if there are 500
or more entities of that kind.
We're currently using the following snippet to work around this issue:
def _all_entities(iterator):
entities, cursor = [], None
while iterator._limit > 0:
xs, more, cursor = iterator.next_page()
iterator._limit -= len(xs)
entities.extend(xs)
if not more:
break
return entities, cursor
Elucidation
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.