diff --git a/src/content/docs/r2/data-catalog/get-started.mdx b/src/content/docs/r2/data-catalog/get-started.mdx index be1639c8238db5..51bb39f08faf27 100644 --- a/src/content/docs/r2/data-catalog/get-started.mdx +++ b/src/content/docs/r2/data-catalog/get-started.mdx @@ -171,7 +171,6 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook import pyarrow.parquet as pq from pyiceberg.catalog.rest import RestCatalog - from pyiceberg.exceptions import NamespaceAlreadyExistsError # Define catalog connection details (replace variables) WAREHOUSE = "" @@ -187,7 +186,6 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook ) return ( CATALOG_URI, - NamespaceAlreadyExistsError, RestCatalog, TOKEN, WAREHOUSE, @@ -200,12 +198,9 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook @app.cell - def _(NamespaceAlreadyExistsError, catalog): + def _(catalog): # Create default namespace if needed - try: - catalog.create_namespace("default") - except NamespaceAlreadyExistsError: - pass + catalog.create_namespace_if_not_exists("default") return