Suppose further that my datastore contains 3281 instances of a Person class. The following output would suggest that the validty of fetch_page() is contingent on the page_size passed in:def allElements(query, page_size=300, keys_only=False):result = []cursor = Nonemore = Truewhile more:models, cursor, more = query.fetch_page(page_size, keys_only=keys_only, start_cursor=cursor)result.extend(models)return result
>>> q = Person.query()>>> for N in [100, 200, 299, 300, 301, 400, 500, 599, 600, 601, 700, 800, 899, 900, 901, 1000]:... print '%4d = %5d' % (N, len(allElements(q, page_size=N, keys_only=True)))
50 = 3281100 = 3281150 = 3281200 = 3281235 = 3281290 = 3281299 = 3281300 = 3281301 = 1781400 = 2000500 = 2081599 = 2381600 = 3281601 = 1803700 = 2081800 = 2081899 = 2081900 = 3281901 = 18021000 = 2000
I would like to know if this also fails with old DB or with datastore_rpc.py.
--Guido van Rossum (on Android)
--Guido
--
--Guido van Rossum (python.org/~guido)