jayceslesar commented on code in PR #2172:
URL: https://github.com/apache/iceberg-python/pull/2172#discussion_r2363540702


##########
pyiceberg/catalog/sql.py:
##########
@@ -572,8 +572,8 @@ def drop_namespace(self, namespace: Union[str, Identifier]) 
-> None:
             raise NoSuchNamespaceError(f"Namespace does not exist: 
{namespace}")
 
         namespace_str = Catalog.namespace_to_string(namespace)
-        if tables := self.list_tables(namespace):
-            raise NamespaceNotEmptyError(f"Namespace {namespace_str} is not 
empty. {len(tables)} tables exist.")
+        if tables := list(self.list_tables(namespace)):
+            raise NamespaceNotEmptyError(f"Namespace {namespace_str} is not 
empty. {len(list(tables))} tables exist.")

Review Comment:
   I see, maybe it makes the most sense to make a little helper function here 
for if a namespace is empty or not? can do that in a different MR but i dont 
know if thats an official method upstream 
https://github.com/search?q=repo%3Aapache%2Ficeberg%20namespacenotempty&type=code



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