You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Box is not out of core: exact quantiles materialize the column #42
The box trace computes exact quantiles with pl.col(...).quantile(...) (flexviz/trace/box.py:145-158), grouped and ungrouped. Polars computes an exact quantile in memory: it materializes the whole data column (per group for the grouped case). So box peak memory grows with row count. It is not O(1) in rows, so box is not true out of core.
This is verified by the OOC matrix test on this branch. box and box-grouped are strict-xfail in tests/test_ooc.py with reason "Polars quantile runs in memory".
State
Polars 1.44 has no approximate/streaming quantile, grouped or ungrouped.
Box stays as is for now.
Option
An approximate box built on the existing histogram fold would give O(1) memory: bin the column once out of core, then read the quantiles off the cumulative bin counts. About 30 lines. Trade exactness for bounded memory. File only if a user needs box on data that does not fit in memory.
Activity
jvdd commentedon Oct 4, 2026
Polars has the following approx quantile function, which is streaming -> https://docs.pola.rs/api/python/version/2/reference/expressions/api/polars.Expr.approx_quantile.html