You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Query.cursor() should not raise an error before being used. Using query.cursor() is None gives a way to check progress in a query. For example, in paging: (addressed in Removing cursor and more results from query object. #432)
query=dataset.query(kind=kind).limit(FETCH_MAX)
results= []
more_results=Truewhilemore_results:
# Make new query.ifquery._cursorisnotNone:
query=query.with_cursor(query._cursor)
curr_results=query.fetch()
results.extend(curr_results)
more_results=len(curr_results) ==FETCH_MAX
Paging with offsets should be a bit more automatic, as it is in gcloud-node. Currently we have to
query=query.offset(offset).limit(limit)
entities=page_query.fetch()
# Offset needs to be reset to 0 since we want to start exactly at `cursor`.next_query=query.with_cursor(cursor).offset(0)
(UPDATED): Consider making bulk-adding properties to Entity more intuitive. See update() override for datastore entities #389. (dict.update() is Pythonic and simple to use / multi-type signature)
Current offenders:
There is no way to(Implemented in Adding a non-protobuf allocate_ids method on Dataset. #436).allocate_idswithout explicitly using protobufs. I have partially addressedTransactions don't give any indication of success or failure (i.e. commit or rollback in(Filed DISCUSSION: Is there a way for a Transaction to indicate success/failure from __exit__ #496)__exit__).Query(and other classes) could be more Pythonic by allowing us to pass values to constructor that also have their own setters. For example:becomesWe don't have to go as extreme as DISCUSSION: Are setter methods which clone and return object type confusing to end-users? #188 by wiping away the(Implemented in Fix #439: split query vs. iterator apart. #487)return selfbehavior in the setters, but could use them in conjuction with more Pythonic constructors.(addressed in Removing cursor and more results from query object. #432)Query.cursor()should not raise an error before being used. Usingquery.cursor() is Nonegives a way to check progress in a query. For example, in paging:(see Removing cursor and more results from query object. #432)Queryshould give access tostart_cursorandend_cursor. It is currently only set on thepb.Comparing
Entityvalues should be easier. Current workaround isPaging with offsets should be a bit more automatic, as it is ingcloud-node. Currently we have to(done in Fix #439: split query vs. iterator apart. #487, since
offsetalways defaults to0)I'm sure there will be plenty more to come after Implementing storage regression tests to match gcloud-node. #319(UPDATED): Consider making bulk-adding properties to(Entitymore intuitive. See update() override for datastore entities #389.dict.update()is Pythonic and simple to use / multi-type signature)(UPDATED): "Creating a new datastore.entity with a key name is a pain." See Creating a new datastore.entity with a key name is a pain #82