GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Removing Iterator and Page subclasses. by dhermes · Pull Request #2558 · googleapis/google-cloud-python

Conversation

@dhermes

@dhermes dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

Instead require Iterator takes:

  • a well-formed path for the request
  • a callable to convert a JSON item to native obj.
  • (optional) the key in a response holding all items
  • (optional) a page_start (acts as proxy for Page.__init__)

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@dhermes dhermes assigned daspecster, tseaver and theacodes Oct 18, 2016
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 18, 2016
@dhermes dhermes mentioned this pull request Oct 18, 2016
Moving to iterators in DNS. #2532
Closed
@theacodes

theacodes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

@dhermes the general idea here LGTM.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver PTAL. I'd really like to get the list_foo() migration done

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes
Removing Iterator and Page subclasses.
8cc9341
Instead require `Iterator` takes:
- a well-formed path for the request
- a callable to convert a JSON item to native obj.
- (optional) the key in a response holding all items
- (optional) a `page_start` (acts as proxy for `Page.__init__`)
@dhermes
dhermes force-pushed the no-more-iterator-subclasses branch from db650b7 to 8cc9341 Compare October 18, 2016 16:39
This was referenced Oct 18, 2016
Moving to iterators in DNS. #2560
Merged
Updating Client.list_* methods in BigQuery to use Iterators. #2561
Merged
@daspecster

daspecster commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

Ditto @jonparrott.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

tseaver
tseaver reviewed Oct 18, 2016
View reviewed changes

@tseaver tseaver left a comment

Copy link
Copy Markdown
Contributor

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.

Except for the odd bit of having item_to_value be optional, this looks right to me.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread core/google/cloud/iterator.py
:param item_to_value: (Optional) Callable to convert an item from JSON
into the native object. Assumed signature
takes an :class:`Iterator` and a dictionary
holding a single item.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Comment thread core/google/cloud/iterator.py Outdated

:type items_key: str
:param items_key: The key used to grab retrieved items from an API
response. Defaults to :data:`DEFAULT_ITEMS_KEY`.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

This comment was marked as spam.

Sign in to view

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver Anything else?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes

dhermes commented Oct 18, 2016 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor Author

@tseaver So I'll add "(Optional)" to the docstring and make item_to_value a positional / required argument. (UPDATE: And fix the lint error. Wrong PR.)

Good to merge after those changes are in?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@tseaver

tseaver commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

@dhermes

Good to merge after those changes are in?

Yup.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes
Making item_to_value a required argument.
b6f5328
Also adding "(Optional)" to items_key docstring.
@dhermes

dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor Author

OK, waited an hour for Travis. Merging. (There is a lot to do after.)

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@dhermes
dhermes merged commit e575f81 into googleapis:master Oct 18, 2016
@dhermes
dhermes deleted the no-more-iterator-subclasses branch October 18, 2016 20:21
@dhermes dhermes mentioned this pull request Nov 14, 2016
Upgrading core to version to 0.21.0. #2733
Merged
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
@dhermes
Merge pull request googleapis#2558 from dhermes/no-more-iterator-subc…
cb5bb26
…lasses

Removing Iterator and Page subclasses.
@theacodes theacodes unassigned daspecster Sep 28, 2018
parthea pushed a commit that referenced this pull request Jun 4, 2023
@dhermes
Merge pull request #2558 from dhermes/no-more-iterator-subclasses
a001cc1
Removing Iterator and Page subclasses.
parthea pushed a commit that referenced this pull request Oct 21, 2023
@crwilcox @busunkim96
fix: Use different versions of pytest for python 2 and python3 [(#2558)…
f86f985
…](GoogleCloudPlatform/python-docs-samples#2558)

* fix: Use different versions of pytest for python 2 and python3

* fix: delete extra pytest dep

* fix: update pytest dependencies in requirements.txt
parthea pushed a commit that referenced this pull request Nov 24, 2025
@dhermes
Merge pull request #2558 from dhermes/no-more-iterator-subclasses
86f60f7
Removing Iterator and Page subclasses.
parthea pushed a commit that referenced this pull request Mar 9, 2026
@dhermes
Merge pull request #2558 from dhermes/no-more-iterator-subclasses
21686ca
Removing Iterator and Page subclasses.
ohmayr added a commit that referenced this pull request Mar 13, 2026
@ohmayr
chore: fix service yaml command in nox sessions (#2558)
2e334b3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@tseaver tseaver tseaver left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@tseaver tseaver

@theacodes theacodes

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@dhermes @theacodes @daspecster @tseaver @googlebot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.