Repository navigation
Honor the limit filter in iter_reviews - #141
Closed
hadrienblanc wants to merge 1 commit into
Closed
hadrienblanc wants to merge 1 commit into
hadrienblanc wants to merge 1 commit into
Conversation
A ReviewFilters limit sets the page size when page_size is not passed, an agreeing pair is accepted, and a conflicting pair raises ValueError before any request. The honored limit keeps the 1..100 bound, in both the sync and async clients.
Author
|
Closing this while I continue the work from my fork. I'll reopen if and when it is ready for another pass. |
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
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.
Fixes #140
Who this serves
Callers that reuse one
ReviewFiltersdict betweenlist_reviewsanditer_reviews.list_reviewssends the dict'slimitas given;iter_reviewssilently replaced it with its ownpage_size(default 100). A limit chosen to keep pages small was widened without a signal, a limit above 100 was narrowed, and the TypeScript SDK — which has no separate knob and sendsquery.limitunchanged — disagreed with Python for the same input.Choices
limitfilter now sets the page size whenpage_sizeis not passed, mirroring how acursorfilter is already honored to resume an iteration.page_size/limitpair is accepted; a conflicting pair raisesValueErrorbefore any request, like the existing pagination bounds, so the silent override becomes a loud one.Verification
tests/test_http.pycover, for both the sync and async client: the limit filter reaches the wire, an agreeing pair is accepted, a conflicting pair raises before any request, and an out-of-bounds limit filter is refused before any request. The first of these fails onmain(limit=100observed on the wire).python3 scripts/check.pypasses in full: pinned tool bootstrap,generate.py --check,contracts.py,ruff check,ruff format --check,mypy proofline,pytest(226 tests, 218 before), wheel and sdist build, and install smoke tests.