rambleraptor commented on issue #3365:
URL:
https://github.com/apache/iceberg-python/issues/3365#issuecomment-4549743763
Iterators don't have a `len` method, so it would throw an error.
What would we think about creating our own list? That way, we can simply add
in pagination ourselves while keeping the list syntax. Here's some quick
example code (I think this would work)
```
class PaginationList(list):
# The list stores a token + callback to fetch new results.
self._pagination_token = ""
self._pagination_callback: Callable = None
# Calls the next page
# If pagination has no results, list will be set to empty.
def next_page() -> None:
tables = catalog.list_tables()
while len(tables) > 0:
for table in tables:
print(table)
tables.next_page()
```
--
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]