pola-rs/polars · error
activate 'propagate_nans' feature
Error message
activate 'propagate_nans' feature
What it means
Panic when evaluating a nan_min/nan_max group-by aggregation while the propagate_nans feature is disabled at compile time: no NaN-propagating implementation exists in this build. Rebuild polars-expr with propagate_nans enabled or use regular min/max.
Source
Thrown at crates/polars-expr/src/expressions/aggregation.rs:90
s,
allow_threading,
),
},
#[cfg(feature = "propagate_nans")]
GroupByMethod::NanMin => parallel_op_columns(
|s| {
Ok(polars_ops::prelude::nan_propagating_aggregate::nan_min_s(
s.as_materialized_series(),
s.name().clone(),
)
.into_column())
},
s,
allow_threading,
),
#[cfg(not(feature = "propagate_nans"))]
GroupByMethod::NanMin => {
panic!("activate 'propagate_nans' feature")
},
GroupByMethod::Max => match s.is_sorted_flag() {
IsSorted::Ascending | IsSorted::Descending => {
s.max_reduce().map(|sc| sc.into_column(s.name().clone()))
},
IsSorted::Not => parallel_op_columns(
|s| s.max_reduce().map(|sc| sc.into_column(s.name().clone())),
s,
allow_threading,
),
},
#[cfg(feature = "propagate_nans")]
GroupByMethod::NanMax => parallel_op_columns(
|s| {
Ok(polars_ops::prelude::nan_propagating_aggregate::nan_max_s(
s.as_materialized_series(),
s.name().clone(),
)View on GitHub (pinned to 9b5d73fd00)
Solutions
- Enable the `propagate_nans` cargo feature for NaN-propagating aggregations.
- Handle NaNs explicitly (fillna/drop_nans) before aggregating without the feature.
Defensive patterns
Strategy: fallback
When it happens
Trigger: This panic/expect fires when execution reaches an unguarded state described by: "activate 'propagate_nans' feature". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.
Common situations: Encountered when input data or configuration does not meet the preconditions of the throwing code path ("activate 'propagate_nans' feature"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.
AI-assisted analysis of pola-rs/polars@9b5d73fd00 (2026-08-19).
Data as JSON: /api/errors/4d5f1a618598b05a.
Report an issue: GitHub.