ebyhr commented on code in PR #3377:
URL: https://github.com/apache/iceberg-python/pull/3377#discussion_r3293657881


##########
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:
   The page size remains constant throughout the `while` loop, unlike the page 
token. That is why I set the value outside the loop. 



-- 
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]

Reply via email to