| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Intended 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.
There was a problem hiding this comment.
My one concern is how a service like datastore will work.
This abstraction seems to completely hides cursors, but cursors often need to be passed between client and server in datastore (think client-side pagination). I'm wondering how that would fit in here?
Sorry, something went wrong.
| """The :class:`Page` is an iterator.""" | ||
| return self | ||
|
|
||
| def _item_to_value(self, item): |
| return self._num_items | ||
|
|
||
| @property | ||
| def remaining(self): |
Datastore has it's own specialized Iterator. For the time being, the google.cloud.iterator.Iterator class is for JSON-based APIs that define a nextPageToken in response pages. 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.
|
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.
|
LGTM |
Sorry, something went wrong.
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.
| Back | FazBrowse Home | New Git URL |
This PR should definitely reviewed commit-by-commit.
Primary changes are: