Skip to content

Migrate datastore iterator to use base iterator class - #2706

Merged
dhermes merged 13 commits into
googleapis:masterfrom
dhermes:migrate-datastore-iterator
Nov 9, 2016
Merged

Migrate datastore iterator to use base iterator class#2706
dhermes merged 13 commits into
googleapis:masterfrom
dhermes:migrate-datastore-iterator

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

I considered

  • Making offset and end_cursor read-only public properties on the subclass
  • Making a @property alias start_cursor that just returns the value of next_page_token
  • Making a @property alias limit that just returns the value of max_results

I elected not to make anything new public since the original implementation didn't.

@jonparrott PTAL as well (do you think this will be too jarring a change?).

@dhermesdhermes added api: datastore Issues related to the Datastore API. api: core labels Nov 8, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Nov 8, 2016

Using the query iterator's
:meth:`~google.cloud.datastore.query.Iterator.next_page` method:
Using the query iterator

This comment was marked as spam.

This comment was marked as spam.

@dhermes
dhermesforce-pushed the migrate-datastore-iterator branch 2 times, most recently from 22578a8 to 0bc7682CompareNovember 8, 2016 18:02
@theacodes

Copy link
Copy Markdown
Contributor

@dhermes thanks, the same is clear and doesn't make a common use case too difficult. I'm cool with this.

@dhermes
dhermesforce-pushed the migrate-datastore-iterator branch from 0bc7682 to 7a97e00CompareNovember 8, 2016 20:39
@dhermes

Copy link
Copy Markdown
ContributorAuthor

@daspecster@tseaver PTAL

>>> query_iter.next_page_token is None
True

Under the hood this is doing:

This comment was marked as spam.

This comment was marked as spam.

@daspecsterdaspecster left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This LGTM to me as well.

@dhermes

dhermes commented Nov 9, 2016

Copy link
Copy Markdown
ContributorAuthor

Going to merge (waiting waited 24h for other feedback)

@dhermes
dhermes merged commit 1abfcbe into googleapis:masterNov 9, 2016
@dhermes
dhermes deleted the migrate-datastore-iterator branch November 9, 2016 17:08
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…rator
Migrate datastore iterator to use base iterator class
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: coreapi: datastoreIssues related to the Datastore API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@dhermes@theacodes@daspecster@tseaver@googlebot