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

Removing Iterator and Page subclasses. by dhermes · Pull Request #2558 · googleapis/google-cloud-python · GitHub

Removing Iterator and Page subclasses. - #2558

Merged
dhermes merged 2 commits into
googleapis:masterfrom
dhermes:no-more-iterator-subclasses
Oct 18, 2016
Merged

Removing Iterator and Page subclasses.#2558
dhermes merged 2 commits into
googleapis:masterfrom
dhermes:no-more-iterator-subclasses

Conversation

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__)

googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 18, 2016

Copy link
Copy Markdown
Contributor

@dhermes the general idea here LGTM.

dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor Author

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

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__`)

Copy link
Copy Markdown
Contributor

Ditto @jonparrott.

tseaver 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

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

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

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

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.

This comment was marked as spam.

This comment was marked as spam.

dhermes commented Oct 18, 2016

Copy link
Copy Markdown
Contributor Author

@tseaver Anything else?

dhermes commented Oct 18, 2016
edited
Loading

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?

tseaver commented Oct 18, 2016

Copy link
Copy Markdown
Contributor

@dhermes

Good to merge after those changes are in?

Yup.

Also adding "(Optional)" to items_key docstring.

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

dhermes merged commit e575f81 into googleapis:master Oct 18, 2016
dhermes deleted the no-more-iterator-subclasses branch October 18, 2016 20:21
richkadel pushed a commit to richkadel/google-cloud-python that referenced this pull request May 6, 2017
…lasses

Removing Iterator and Page subclasses.
parthea pushed a commit that referenced this pull request Jun 4, 2023
parthea pushed a commit that referenced this pull request Oct 21, 2023
…](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
parthea pushed a commit that referenced this pull request Mar 9, 2026
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

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