-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Removing Iterator and Page subclasses. #2558
Removing Iterator and Page subclasses. #2558
Conversation
@dhermes the general idea here LGTM. |
@tseaver PTAL. I'd really like to get the |
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__`)
db650b7
to
8cc9341
Compare
Ditto @jonparrott. |
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.
: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.
Sorry, something went wrong.
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.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
|
||
: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.
Sorry, something went wrong.
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.
@tseaver Anything else? |
@tseaver So I'll add "(Optional)" to the docstring and make Good to merge after those changes are in? |
Yup. |
Also adding "(Optional)" to items_key docstring.
OK, waited an hour for Travis. Merging. (There is a lot to do after.) |
…lasses Removing Iterator and Page subclasses.
Removing Iterator and Page subclasses.
…](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
Instead require
Iterator
takes:page_start
(acts as proxy forPage.__init__
)