MCPcopy
hub / github.com/marimo-team/marimo / check_for_errors

Function check_for_errors

marimo/_lint/validate_graph.py:19–47  ·  view source on GitHub ↗

Check graph for violations of marimo semantics. Return a dict of errors in the graph, with an entry for each cell that is involved in an error.

(
    graph: DirectedGraph,
)

Source from the content-addressed store, hash-verified

17
18
19def check_for_errors(
20 graph: DirectedGraph,
21) -> dict[CellId_t, tuple[Error, ...]]:
22 """
23 Check graph for violations of marimo semantics.
24
25 Return a dict of errors in the graph, with an entry for each cell
26 that is involved in an error.
27 """
28 multiple_definition_errors = check_for_multiple_definitions(graph)
29 cycle_errors = check_for_cycles(graph)
30 invalid_root_errors = check_for_invalid_root(graph)
31
32 errors: dict[CellId_t, tuple[Error, ...]] = {}
33 for cid in set(
34 itertools.chain(
35 multiple_definition_errors.keys(),
36 cycle_errors.keys(),
37 invalid_root_errors.keys(),
38 )
39 ):
40 errors[cid] = tuple(
41 itertools.chain(
42 multiple_definition_errors[cid],
43 cycle_errors[cid],
44 invalid_root_errors[cid],
45 )
46 )
47 return errors
48
49
50def check_for_multiple_definitions(

Calls 5

check_for_cyclesFunction · 0.85
check_for_invalid_rootFunction · 0.85
chainMethod · 0.80
keysMethod · 0.45

Used in the wild real call sites across dependent graphs

searching dependent graphs…