Skip to content

A reactive notebook for Python — run reproducible experiments, query with SQL, execute as a script, deploy as an app, and version with git. Stored as pure Python. All in a modern, AI-native editor.

fix: improve error handling for pyiceberg list_namespaces permission errors (#7864)

Vedant Madaneeb98a06b0525
diff --git a/marimo/_sql/engines/pyiceberg.py b/marimo/_sql/engines/pyiceberg.py
index 4501669e69..f4df867624 100644
--- a/marimo/_sql/engines/pyiceberg.py
+++ b/marimo/_sql/engines/pyiceberg.py
@@ -106,8 +106,16 @@ class PyIcebergEngine(EngineCatalog["Catalog"]):
engine=self._engine_name,
)
)
- except Exception:
- LOGGER.warning("Failed to get databases", exc_info=True)
+ except Exception as e:
+ # Check if this is a permission/auth error (e.g., 403 Forbidden)
+ error_str = str(e).lower()
+ if "403" in error_str or "forbidden" in error_str:
+ LOGGER.debug(
+ "Cannot list namespaces due to insufficient permissions. "
+ "You can still access tables if you know the namespace name."
+ )
+ else:
+ LOGGER.warning("Failed to get databases", exc_info=True)
return databases