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: disable transitively status (#1992)

Akshay Agrawal2b645abe7612
diff --git a/frontend/src/components/editor/actions/useCellActionButton.tsx b/frontend/src/components/editor/actions/useCellActionButton.tsx
index b12703e57f..20be54f7b7 100644
--- a/frontend/src/components/editor/actions/useCellActionButton.tsx
+++ b/frontend/src/components/editor/actions/useCellActionButton.tsx
@@ -257,11 +257,11 @@ export function useCellActionButtons({ cell }: Props) {
},
{
icon: config.disabled ? (
- <ZapIcon size={13} strokeWidth={1.5} />
- ) : (
<ZapOffIcon size={13} strokeWidth={1.5} />
+ ) : (
+ <ZapIcon size={13} strokeWidth={1.5} />
),
- label: config.disabled ? "Enable cell" : "Disable cell",
+ label: "Reactive execution",
rightElement: (
<Switch
data-testid="cell-disable-switch"
diff --git a/marimo/_runtime/runner/cell_runner.py b/marimo/_runtime/runner/cell_runner.py
index 8da7b8ab98..7671e61c1c 100644
--- a/marimo/_runtime/runner/cell_runner.py
+++ b/marimo/_runtime/runner/cell_runner.py
@@ -508,9 +508,15 @@ class Runner:
cell_id = self.pop_cell()
if self.cancelled(cell_id):
continue
+ cell = self.graph.cells[cell_id]
+ if cell.config.disabled:
+ cell.set_status("idle")
+ continue
if self.graph.is_disabled(cell_id):
+ # hack: frontend sets status to queued on run, have to
+ # set status here to get FE to transition.
+ cell.set_status("disabled-transitively")
continue
- cell = self.graph.cells[cell_id]
for pre_hook in self.pre_execution_hooks:
pre_hook(cell, self)
if self.execution_context is not None: