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.

Discourage casual cell naming in code mode (#8804)

Trevor Manz67a29ecc3581
diff --git a/marimo/_code_mode/_context.py b/marimo/_code_mode/_context.py
index c7ffb36491..ab47a3d920 100644
--- a/marimo/_code_mode/_context.py
+++ b/marimo/_code_mode/_context.py
@@ -555,10 +555,6 @@ class AsyncCodeModeContext:
# Create and run
cid = ctx.create_cell("x = 1")
ctx.run_cell(cid)
-
- # Create a setup cell with imports, then a cell that uses them
- ctx.create_cell("import marimo as mo", name="setup")
- ctx.create_cell("mo.md('# Hello')", name="greeting")
```
Args:
@@ -572,8 +568,10 @@ class AsyncCodeModeContext:
disabled (bool): Prevent the cell from executing.
Defaults to False.
column (int, optional): Column index for multi-column layouts.
- name (str, optional): Name for the cell (e.g. ``"data_loader"``,
- ``"setup"`` for a setup cell).
+ name (str, optional): Cell names are a human-facing label,
+ reserved for special cases (e.g. ``"setup"``). Prefer
+ referencing cells by the returned cell ID unless
+ naming is important for the user.
"""
self._require_entered()
if before is not None and after is not None: