Node
Single workbook cell in a dependency graph.
Usage
Node()Canonical identity is address (CellKey). Change it through DependencyGraph.move_node; assigning address directly raises so relative formula axes cannot silently retarget. Legacy constructors that pass sheet/column/row still work and sync address in __init__.
formula_ast is the primary in-memory formula artifact. Construct nodes with formula_ast= when the tree is already known. normalized_formula is a derived view (render_formula with A1_ABSOLUTE); it is not stored, and the constructor keyword of the same name is only a bootstrap for string input. When an address is available, that bootstrap parses with parse_preserving_axes so $ vs bare A1 is kept; without an anchor, relative intent cannot be recovered. Unparseable cells keep the last known formula text as a fallback so has_formula still holds. DependencyGraph.formula_shapes is an optional eval/codegen overlay; missing or dropped shapes fall back to this AST. The raw workbook string formula is opt-in at extraction (create_dependency_graph(store_raw_formula=True)) and audit-only – on a compressed graph it still holds the pre-compression text, so never re-parse it as the node’s current definition.
is_leaf is true when the node has no outgoing dependency edges (value-only cells and literal-only formulas such as =1+1).
is_array_formula is true when extraction observed a fastpyxl ArrayFormula on this cell. array_formula_ref is the spill / CSE range Excel stored (ref, e.g. E1:E10), or None when that attribute was missing. Write-back emits ArrayFormula from these fields and refuses to scalarize a flagged cell whose ref was not observed. fastpyxl does not distinguish legacy CSE from dynamic-array spills; both round-trip as t="array".
Instances are slotted (no per-instance __dict__). Derived attributes (key, shape, column_index) are served from a process-wide LRU keyed on the canonical address rather than functools.cached_property.
metadata is a read-only Mapping for callers. Nodes without metadata share the immutable EMPTY_METADATA singleton instead of allocating a dict, so node.metadata["k"] = v is not supported (it raises TypeError on a node with no metadata yet). Writers — node hooks included — use set_metadata / update_metadata, or DependencyGraph.set_node_metadata.
Dimension binds and key coordinates live on SeriesCatalog, not on this node. key_point(catalog) and dimension_binds(catalog) are thin adapters that return None for unbound cells.
Parameter Attributes
sheet: str | None = Nonecolumn: str | None = Nonerow: int | None = Noneformula: str | None = Nonevalue: Any = Noneis_leaf: bool = Trueis_target: bool = Falsemetadata: Mapping[str, Any] = EMPTY_METADATAmin_col: str | None = Nonemin_row: int | None = Nonemax_col: str | None = Nonemax_row: int | None = Noneaddress: CellKey | None = Noneformula_ast: AstNode | None = Nonenormalized_formula: str | None = Noneis_array_formula: bool = Falsearray_formula_ref: str | None = None