FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Migrate datastore iterator to use base iterator class by dhermes · Pull Request #2706 · googleapis/google-cloud-python · GitHub

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 commented Nov 8, 2016

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?).

dhermes added api: datastore Issues related to the Datastore API. api: core labels Nov 8, 2016
googlebot 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 force-pushed the migrate-datastore-iterator branch 2 times, most recently from 22578a8 to 0bc7682 Compare November 8, 2016 18:02

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 force-pushed the migrate-datastore-iterator branch from 0bc7682 to 7a97e00 Compare November 8, 2016 20:39

dhermes commented Nov 8, 2016

Copy link
Copy Markdown
Contributor Author

@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.

daspecster 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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

This LGTM to me as well.

dhermes commented Nov 9, 2016
edited
Loading

Copy link
Copy Markdown
Contributor Author

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

dhermes merged commit 1abfcbe into googleapis:master Nov 9, 2016
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: core api: datastore Issues related to the Datastore API. cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants


Back | FazBrowse Home | New Git URL