MonkeyCanCode commented on code in PR #5147:
URL: https://github.com/apache/polaris/pull/5147#discussion_r3649612998


##########
client/python/apache_polaris/cli/command/setup.py:
##########
@@ -428,9 +444,7 @@ def _export_namespaces_for_catalog(
         catalog_api_client = self._get_catalog_api(api)
         catalog_api = IcebergCatalogAPI(catalog_api_client)
         try:
-            namespaces = sorted(
-                catalog_api.list_namespaces(prefix=catalog_name).namespaces
-            )
+            namespaces = self._list_namespaces_recursively(catalog_api, 
catalog_name)

Review Comment:
   Good catch on this one. As now this is doing namespace traversal, we are 
doing two traversal per catalog between `_export_namespaces_for_catalog` and 
`_export_policies_for_catalog` which can be a lot api calls for a large 
deployment. In that case, would suggest to call `_list_namespaces_recursively` 
in `_export_catalogs` once then pass in namespaces into these two functions. 
WDYT?



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

Reply via email to