Add new DB methods for iterating over paginated results #665
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.
This adds a new set of
get_*()
methods to replacelist_*()
indb.Client
. For example,get_pages()
replaceslist_pages()
.These new methods return an iterator over the entire result set rather than a single, paginated chunk of results. They make for much nicer usage and should make #664 easier.
The old methods will eventually be removed; they’re not what you want 99% of the time, and when you do need them, you can still call
client.request_json()
. It’s slightly more verbose, but that’s OK for the uncommon use case.Fixes #660.