Skip to content

Making max_results part of the base Iterator class. - #2490

Merged
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:fix-1467
Oct 4, 2016
Merged

Making max_results part of the base Iterator class.#2490
dhermes merged 1 commit into
googleapis:masterfrom
dhermes:fix-1467

Conversation

@dhermes

Copy link
Copy Markdown
Contributor

In the process, also making sure to lower maxResults on subsequent requests.

Fixes#1467.

@dhermesdhermes added api: storage Issues related to the Cloud Storage API. api: core labels Oct 4, 2016
@googlebotgooglebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 4, 2016
Comment threadcore/google/cloud/iterator.py Outdated
except StopIteration:
item = self._update_items()
self.num_results += 1
return item

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

@dhermes

Copy link
Copy Markdown
ContributorAuthor

I'm very open to suggestions on other unit / system tests I could add to this PR. Just wanted to get it out there for discussion's sake.

In the process, also making sure to lower maxResults
on subsequent requests.
Fixesgoogleapis#1467.
@tseaver

Copy link
Copy Markdown
Contributor

I would've thought changing to use google.cloud.iterator.MethodIterator everywhere would have been more straightforward (and giving us a clearer path toward a general solution for #895). The derived iterator classes feel like roach motels to me.

@dhermes

Copy link
Copy Markdown
ContributorAuthor

@tseaver This is just a band-aid for #1467. I will probably start from scratch / build on top of MethodIterator when finishing #895.

@dhermes
dhermes merged commit 8c50e41 into googleapis:masterOct 4, 2016
@dhermes
dhermes deleted the fix-1467 branch October 4, 2016 21:55
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
Making max_results part of the base Iterator class.
parthea pushed a commit that referenced this pull request Apr 1, 2026
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: coreapi: storageIssues related to the Cloud Storage API.cla: yesThis human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@dhermes@tseaver@daspecster@googlebot