REST: Add pagination support for list_views#3349
Conversation
| assert RestCatalog("rest", uri=TEST_URI, token=TEST_TOKEN).list_views(namespace) == [("examples", "fooshare")] | ||
|
|
||
|
|
||
| def test_list_views_paginated_200(rest_mock: Mocker) -> None: |
There was a problem hiding this comment.
Can we add some tests for an ommitted field and null for the next_page_token, and ensure the behavior is the same?
There was a problem hiding this comment.
This test (test_list_views_paginated_200) verifies the omitted next-page-token field. Added another test with "next-page-token": None.
Let me know if you want me to add more tests.
efcbf5b to
8a82b35
Compare
8a82b35 to
45efdfd
Compare
|
Open question for the community: do we want pagination to happen automatically? If you have hundreds of pages of views, calling I'm personally in favor of having users manually do pagination and/or having a |
|
@rambleraptor I don't believe this is the most suitable place for discussing this topic. Implementing a |
|
I'm saying that PyIceberg users should have a way to call list_views with/without pagination automatically applied. This wouldn't be a Catalog specification change. It's just an interface choice for PyIceberg. |
|
@rambleraptor, I'm confused. The pagination is actually managed by the REST catalog server. PyIceberg is a client calling the endpoints. What happens when |
Rationale for this change
Follows REST catalog spec:
Are these changes tested?
Yes, includes unit tests for paginated cases.
Are there any user-facing changes?