{"record":{"id":"4d5f1a618598b05a","repo":"pola-rs/polars","slug":"activate-propagate-nans-feature","errorCode":null,"errorMessage":"activate 'propagate_nans' feature","messagePattern":"activate 'propagate_nans' feature","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-expr/src/expressions/aggregation.rs","lineNumber":90,"sourceCode":"                    s,\n                    allow_threading,\n                ),\n            },\n            #[cfg(feature = \"propagate_nans\")]\n            GroupByMethod::NanMin => parallel_op_columns(\n                |s| {\n                    Ok(polars_ops::prelude::nan_propagating_aggregate::nan_min_s(\n                        s.as_materialized_series(),\n                        s.name().clone(),\n                    )\n                    .into_column())\n                },\n                s,\n                allow_threading,\n            ),\n            #[cfg(not(feature = \"propagate_nans\"))]\n            GroupByMethod::NanMin => {\n                panic!(\"activate 'propagate_nans' feature\")\n            },\n            GroupByMethod::Max => match s.is_sorted_flag() {\n                IsSorted::Ascending | IsSorted::Descending => {\n                    s.max_reduce().map(|sc| sc.into_column(s.name().clone()))\n                },\n                IsSorted::Not => parallel_op_columns(\n                    |s| s.max_reduce().map(|sc| sc.into_column(s.name().clone())),\n                    s,\n                    allow_threading,\n                ),\n            },\n            #[cfg(feature = \"propagate_nans\")]\n            GroupByMethod::NanMax => parallel_op_columns(\n                |s| {\n                    Ok(polars_ops::prelude::nan_propagating_aggregate::nan_max_s(\n                        s.as_materialized_series(),\n                        s.name().clone(),\n                    )","sourceCodeStart":72,"sourceCodeEnd":108,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-expr/src/expressions/aggregation.rs#L72-L108","documentation":"In aggregation expression evaluation, GroupByMethod::NanMin (NaN-skipping minimum) is only compiled when the `propagate_nans` feature is enabled. Without it, selecting nan_min in a group_by aggregation panics at evaluation time.","triggerScenarios":"Using an aggregation expression like col(\"x\").nan_min() (GroupByMethod::NanMin) inside group_by/agg on a build without the `propagate_nans` feature.","commonSituations":"Default polars builds (propagate_nans is opt-in); notebooks or libraries built with reduced features; copying examples that use nan_min without adding the feature.","solutions":["Enable the feature: polars = { ..., features = [\"propagate_nans\"] }","Use plain min() aggregation if NaN-skipping semantics are not required","Filter NaNs manually before aggregating: col(\"x\").filter(col(\"x\").is_not_nan()).min() inside agg context"],"exampleFix":"// before\npolars = { version = \"0.46\", features = [\"lazy\"] }\n// after\npolars = { version = \"0.46\", features = [\"lazy\", \"propagate_nans\"] }","handlingStrategy":"validation","validationCode":"fn agg_supported(m: GroupByMethod) -> bool {\n    !matches!(m, GroupByMethod::NanMin | GroupByMethod::NanMax) // unless propagate_nans enabled\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable propagate_nans whenever aggregations may reference nan_min/nan_max","Validate user-built aggregation expressions against compiled features","Prefer min/max plus explicit is_not_nan filters for portability"],"tags":["rust","polars","feature-flags","aggregation"],"backgroundTag":"feature-not-enabled","analyzedSha":"fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e","analyzedAt":"2026-09-18T22:14:11.667Z","contentChangedAt":"2026-09-18T22:14:11.667Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}