Back to Marimo

MB003: cycle-dependencies

docs/guides/lint_rules/rules/cycle_dependencies.md

0.23.5942 B
Original Source

MB003: cycle-dependencies

🚨 Breaking āŒ Not Fixable

MB003: Cells have circular dependencies.

What it does

Analyzes the dependency graph to detect circular references between cells, where cells depend on each other in a way that creates an impossible execution order.

Why is this bad?

Circular dependencies prevent marimo from:

  • Determining a valid execution order
  • Running notebooks reproducibly
  • Executing notebooks as scripts
  • Providing reliable reactive updates

This is a breaking error because it makes the notebook non-executable.

Examples

Problematic:

python
# Cell 1
a = b + 1  # Reads b

# Cell 2
b = a + 1  # Reads a -> Cycle!

Solution:

python
# Cell 1
a = 1

# Cell 2
b = a + 1  # Unidirectional dependency

References