Repository navigation
Conversation
|
| **Migration:** Update pagination code to work with `SyncPage` or `AsyncPage`, and use `page.data`, `page.before`, `page.after`, or iteration over the page as needed. | ||
| **Migration:** Update pagination code to work with `SyncPage` or `AsyncPage`, and use `page.data`, `page.before`, `page.after`, or `auto_paging_iter()` as needed. | ||
|
|
||
| **Breaking change (v11):** Iterating a page directly (`for organization in page`, `async for`) yields only the current page's `data` and makes no further requests. In v6–v10 it auto-paginates; in v11, call `page.auto_paging_iter()` to iterate across all pages. |
There was a problem hiding this comment.
V11 guidance is hard to find The instruction for upgrading page iteration to v11 appears only in this v5-to-v6 migration guide. Developers upgrading from v10 may miss the need to use
auto_paging_iter() and silently process only the first page. Please put the instruction somewhere v11 users are likely to look.
Prompt To Fix With AI
This is a comment left during a code review.
Path: docs/V6_MIGRATION_GUIDE.md
Line: 283
Comment:
**V11 guidance is hard to find** The instruction for upgrading page iteration to v11 appears only in this v5-to-v6 migration guide. Developers upgrading from v10 may miss the need to use `auto_paging_iter()` and silently process only the first page. Please put the instruction somewhere v11 users are likely to look.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
I found that looping over a list response silently fetched every remaining page.
for x in page/async for x in pagenow yield only the current page's items and make no further requests.page.auto_paging_iter()remains the explicit way to iterate across all pages.Migration: replace
for x in pagewithfor x in page.auto_paging_iter()(likewiseasync for) to keep iterating across pages.Test plan
mise x uv -- uv run pytest -q tests/test_pagination.py -k PageLocalIteration— both the sync and async test fail withWorkOSTimeoutError, because plain iteration issues a second HTTP request the mock has no response queued for.list_metadata.afterset.