Anurag-S1ngh opened a new pull request, #4483: URL: https://github.com/apache/iceberg-python/pull/4483
# Rationale for this change `RestCatalog.list_namespaces`, `list_tables`, and `list_views` currently walk every page before returning. Callers that only need the first few results still pay for all the network calls. This adds a `PaginationList` that loads the first page eagerly and fetches later pages only when iteration or indexing moves past the loaded items. Operations that need the complete result set, such as `len()`, `in`, slicing, negative indexes, `repr()`, `sort()`, and `reverse()`, fetch all remaining pages first. The return type stays a `list` subclass, so existing callers keep their list semantics. Retries are applied to each lazily fetched page. Closes #3365. ## Are these changes tested? Yes. Added unit tests for `PaginationList` covering lazy iteration, early exit, indexing, slicing, and list operations, plus a REST test that asserts the second page is not requested until iteration passes the first page. - `pytest tests/ -m unit --ignore=tests/integration`: 4893 passed, 6 skipped - `ruff check` and `ruff format --check` pass - `ty check` reports only the two pre-existing `model_dump` diagnostics in `typedef.py` ## Are there any user-facing changes? The three list methods now return a `PaginationList` instead of a plain list. It behaves like a list, including `len()` and equality, but may defer network calls until callers reach later items. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
