From 3dc34769a2f92348e3f6a064880ada99f144f20f Mon Sep 17 00:00:00 2001 From: Phillip Jones Date: Sun, 25 May 2025 12:37:22 -0700 Subject: [PATCH 1/2] Minor fixes in R2 Data Catalog getting started docs: adds missing dependencies, adds marimo edit command --- .../docs/r2/data-catalog/get-started.mdx | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/src/content/docs/r2/data-catalog/get-started.mdx b/src/content/docs/r2/data-catalog/get-started.mdx index deef04fcc9a1359..9bae7c371e8c091 100644 --- a/src/content/docs/r2/data-catalog/get-started.mdx +++ b/src/content/docs/r2/data-catalog/get-started.mdx @@ -112,7 +112,7 @@ Iceberg clients (including [PyIceberg](https://py.iceberg.apache.org/)) must aut You need to install a Python package manager. In this guide, use [uv](https://docs.astral.sh/uv/). If you do not already have uv installed, follow the [installing uv guide](https://docs.astral.sh/uv/getting-started/installation/). -## 5. Install marimo +## 5. Install marimo and set up your project with uv We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook. @@ -123,29 +123,23 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook mkdir r2-data-catalog-notebook ``` -2. Change into our new directory: +2. Change into our new directory: - ``` - cd r2-data-catalog-notebook - ``` + ``` + cd r2-data-catalog-notebook + ``` -3. Create a new Python virtual environment: - - ``` - uv venv - ``` +3. Initialize a new uv project (this creates a `.venv` and a `pyproject.toml`): -4. Activate the Python virtual environment: + ``` + uv init + ``` - ``` - source .venv/bin/activate - ``` +5. Add marimo and required dependencies: -5. Install marimo with uv: - - ```py - uv pip install marimo - ``` + ```py + uv add marimo pyiceberg pyarrow pandas + ``` @@ -154,7 +148,7 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook 1. Create a file called `r2-data-catalog-tutorial.py`. -2. Paste the following code snippet into your `r2-data-catalog-tutorial.py` file: +2. Paste the following code snippet into your `r2-data-catalog-tutorial.py` file: ```py import marimo @@ -269,7 +263,15 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook app.run() ``` -3. Replace the `CATALOG_URI`, `WAREHOUSE`, and `TOKEN` variables with your values from sections **2** and **3** respectively. +3. Replace the `CATALOG_URI`, `WAREHOUSE`, and `TOKEN` variables with your values from sections **2** and **3** respectively. + +4. Launch the notebook editor in your browser: + + ``` + uv run marimo edit r2-data-catalog-tutorial.py + ``` + + Once your notebook connects to the catalog, you'll see the catalog along with its namespaces and tables appear in marimo's Datasources panel. In the Python notebook above, you: From 08d792c36fd34617fa924ae2bcc707ec8509425e Mon Sep 17 00:00:00 2001 From: Jun Lee Date: Tue, 27 May 2025 17:22:02 +0100 Subject: [PATCH 2/2] Update src/content/docs/r2/data-catalog/get-started.mdx --- src/content/docs/r2/data-catalog/get-started.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/content/docs/r2/data-catalog/get-started.mdx b/src/content/docs/r2/data-catalog/get-started.mdx index 9bae7c371e8c091..be1639c8238db51 100644 --- a/src/content/docs/r2/data-catalog/get-started.mdx +++ b/src/content/docs/r2/data-catalog/get-started.mdx @@ -135,7 +135,7 @@ We will use [marimo](https://github.com/marimo-team/marimo) as a Python notebook uv init ``` -5. Add marimo and required dependencies: +4. Add marimo and required dependencies: ```py uv add marimo pyiceberg pyarrow pandas