GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | |||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | |||||||||||||||||||||||||||
GeezerVison is showing github.com — Re-architect Iterator class. by dhermes · Pull Request #2531 · googleapis/google-cloud-python Conversation
Contributor
This PR should definitely reviewed commit-by-commit. Primary changes are:
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactionsIntended to hold and slice up state that has already been retrieved from the server. This is so that the owned items iterator management could be done on the base class and the child classes just need to worry about converting the JSON values to whatever type is required. This state can never happen since a StopIteration will occur before the method would ever be called without a token. Also doing a tiny re-org in constructor to separate the attributes which change and those which don't. Making JSON API call helpers non-public. This reduces the interface to methods relevant to iterating.
dhermes
force-pushed
the
revamp-iterator
branch
from
6d50cf6 to
d9824c6
Compare
theacodes
reviewed
|
| """The :class:`Page` is an iterator.""" | ||
| return self | ||
|
|
||
| def _item_to_value(self, item): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| return self._num_items | ||
|
|
||
| @property | ||
| def remaining(self): |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
Datastore has it's own specialized Though a "next step" would be to make the iterator support gRPC / GAPIC generated classes, so we may be able to tackle datastore there. (Just not in this PR.) |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
Sorry I haven't responded on this @dhermes. I don't have much feedback though. You actually just answered the question I did have.
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
|
LGTM |
Sorry, something went wrong.
There was an error while loading. Please reload this page.
This is to lower the burden on implementers. The previous approach (requiring a Page and Iterator subclass) ended up causing lots of copy-pasta docstrings that were just a distraction. Follow up to googleapis#2531.
Re-architect Iterator class.
This is to lower the burden on implementers. The previous approach (requiring a Page and Iterator subclass) ended up causing lots of copy-pasta docstrings that were just a distraction. Follow up to googleapis#2531.
This is to lower the burden on implementers. The previous approach (requiring a Page and Iterator subclass) ended up causing lots of copy-pasta docstrings that were just a distraction. Follow up to #2531.
This is to lower the burden on implementers. The previous approach (requiring a Page and Iterator subclass) ended up causing lots of copy-pasta docstrings that were just a distraction. Follow up to #2531.
This is to lower the burden on implementers. The previous approach (requiring a Page and Iterator subclass) ended up causing lots of copy-pasta docstrings that were just a distraction. Follow up to #2531.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.