-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Migrate datastore iterator to use base iterator class #2706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrate datastore iterator to use base iterator class #2706
Conversation
| 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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
22578a8 to
0bc7682
Compare
|
@dhermes thanks, the same is clear and doesn't make a common use case too difficult. I'm cool with this. |
Removing an unused import and also adding a class-level attribute for ``next_page_token`` which gets set outside of the constructor (Pylint seems to miss the fact that it gets set in the constructor of the base class).
0bc7682 to
7a97e00
Compare
|
@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.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
daspecster
left a comment
There was a problem hiding this comment.
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.
|
Going to merge ( |
…rator Migrate datastore iterator to use base iterator class
I considered
offsetandend_cursorread-only public properties on the subclass@propertyaliasstart_cursorthat just returns the value ofnext_page_token@propertyaliaslimitthat just returns the value ofmax_resultsI 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?).