Skip to content

Honor the limit filter in iter_reviews - #141

Closed
hadrienblanc wants to merge 1 commit into
prooflinedev:mainfrom
hadrienblanc:fix/iter-reviews-limit-filter
Closed

hadrienblanc wants to merge 1 commit into
prooflinedev:mainfrom
hadrienblanc:fix/iter-reviews-limit-filter

Conversation

@hadrienblanc

Copy link
Copy Markdown

Fixes #140

Who this serves

Callers that reuse one ReviewFilters dict between list_reviews and iter_reviews. list_reviews sends the dict's limit as given; iter_reviews silently replaced it with its own page_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 sends query.limit unchanged — disagreed with Python for the same input.

Choices

  • A limit filter now sets the page size when page_size is not passed, mirroring how a cursor filter is already honored to resume an iteration.
  • An agreeing page_size/limit pair is accepted; a conflicting pair raises ValueError before any request, like the existing pagination bounds, so the silent override becomes a loud one.
  • The honored limit keeps the 1..100 bound, so the page size the iterator counts pages and items against stays validated.
  • Both clients change together, and the README documents the rule.

Verification

  • New tests in tests/test_http.py cover, 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 on main (limit=100 observed on the wire).
  • python3 scripts/check.py passes 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.

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.
@hadrienblanc

Copy link
Copy Markdown
Author

Closing this while I continue the work from my fork. I'll reopen if and when it is ready for another pass.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iter_reviews silently replaces a limit filter with its own page size

1 participant