kevinjqliu commented on code in PR #3377:
URL: https://github.com/apache/iceberg-python/pull/3377#discussion_r3293628104
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -1126,12 +1128,20 @@ def list_views(self, namespace: str | Identifier) ->
list[Identifier]:
namespace_tuple = self._check_valid_namespace_identifier(namespace)
namespace_concat = self._encode_namespace_path(namespace_tuple)
url = self.url(Endpoints.list_views, namespace=namespace_concat)
+ params = {}
+ page_size = property_as_int(self.properties, PAGE_SIZE, None)
+ if page_size is not None:
+ if page_size <= 0:
+ raise ValueError(f"{PAGE_SIZE} must be a positive integer")
+ params["pageSize"] = str(page_size)
Review Comment:
```suggestion
page_size = property_as_int(self.properties, PAGE_SIZE, None)
if page_size is not None and page_size <= 0:
raise ValueError(f"{PAGE_SIZE} must be a positive integer")
```
nit
##########
pyiceberg/catalog/rest/__init__.py:
##########
@@ -1126,12 +1128,20 @@ def list_views(self, namespace: str | Identifier) ->
list[Identifier]:
namespace_tuple = self._check_valid_namespace_identifier(namespace)
namespace_concat = self._encode_namespace_path(namespace_tuple)
url = self.url(Endpoints.list_views, namespace=namespace_concat)
+ params = {}
+ page_size = property_as_int(self.properties, PAGE_SIZE, None)
+ if page_size is not None:
+ if page_size <= 0:
+ raise ValueError(f"{PAGE_SIZE} must be a positive integer")
+ params["pageSize"] = str(page_size)
views: list[Identifier] = []
page_token: str | None = None
while True:
- params = {"pageToken": page_token} if page_token else None
+ if page_token:
+ params["pageToken"] = page_token
Review Comment:
```suggestion
params: dict[str, str] = {}
if page_size is not None:
params["pageSize"] = str(page_size)
if page_token:
params["pageToken"] = page_token
```
nit: follows the same pattern as list_namespaces (#3347) and list_tables
(#3348)
--
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]