dannycjones commented on code in PR #2570:
URL: https://github.com/apache/iceberg-rust/pull/2570#discussion_r3368051874


##########
crates/catalog/glue/src/catalog.rs:
##########
@@ -504,9 +504,21 @@ impl Catalog for GlueCatalog {
         }
 
         let db_name = validate_namespace(namespace)?;
-        let table_list = self.list_tables(namespace).await?;
 
-        if !table_list.is_empty() {
+        // Check for ANY Glue table in the database, not just Iceberg tables.
+        // Glue's `delete_database` will fail if any table (Iceberg or not) is
+        // still present, and `list_tables` only returns Iceberg tables, so we
+        // query Glue directly here.
+        let builder = self
+            .client
+            .0
+            .get_tables()
+            .database_name(&db_name)
+            .max_results(1);
+        let builder = with_catalog_id!(builder, self.config);
+        let resp = builder.send().await.map_err(from_aws_sdk_error)?;
+
+        if !resp.table_list().is_empty() {

Review Comment:
   One thing PyIceberg does is tailor the error message to inform the user if 
it's Iceberg or non-Iceberg tables remaining in the list. I think we should do 
the same here.



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