Skip to main content

MAX_EXPR_DEPTH

Constant MAX_EXPR_DEPTH 

Source
pub const MAX_EXPR_DEPTH: usize = 512;
Expand description

The deepest expression tree the parser builds (a leaf is depth 1).

pandas 2.2.3 evaluates through recursive Python visitors, so under CPython’s default recursion limit it raises RecursionError once nesting passes about 330 levels (a + a + ..., 1 ** 1 ** ...) to 490 (- - a, not not ..., x & x & ...). Every expression pandas evaluates fits under this bound; a deeper one is a parse error here, never a stack overflow while parsing, evaluating, cloning or dropping it.