{"record":{"id":"564ca96d99c0542e","repo":"pola-rs/polars","slug":"activate-feature-dynamic-group-by-564ca9","errorCode":null,"errorMessage":"activate feature dynamic_group_by","messagePattern":"activate feature dynamic_group_by","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-mem-engine/src/executors/group_by_dynamic.rs","lineNumber":87,"sourceCode":"                *key = key.slice(offset, len)\n            }\n        }\n\n        let agg_columns = evaluate_aggs(&df, &self.aggs, groups, state)?;\n\n        let mut columns = Vec::with_capacity(agg_columns.len() + 1 + keys.len());\n        columns.extend_from_slice(&keys);\n        columns.push(time_key);\n        columns.extend(agg_columns);\n\n        DataFrame::new_infer_height(columns)\n    }\n}\n\nimpl Executor for GroupByDynamicExec {\n    #[cfg(not(feature = \"dynamic_group_by\"))]\n    fn execute(&mut self, _state: &mut ExecutionState) -> PolarsResult<DataFrame> {\n        panic!(\"activate feature dynamic_group_by\")\n    }\n\n    #[cfg(feature = \"dynamic_group_by\")]\n    fn execute(&mut self, state: &mut ExecutionState) -> PolarsResult<DataFrame> {\n        state.should_stop()?;\n        #[cfg(debug_assertions)]\n        {\n            if state.verbose() {\n                eprintln!(\"run GroupbyDynamicExec\")\n            }\n        }\n        let df = self.input.execute(state)?;\n        self.execute_impl(state, df)\n    }\n}\n","sourceCodeStart":69,"sourceCodeEnd":103,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-mem-engine/src/executors/group_by_dynamic.rs#L69-L103","documentation":"The memory-engine's GroupByDynamic executor has a stub implementation when the `dynamic_group_by` cargo feature is disabled: execute() immediately panics telling the user to activate the feature. Dynamic group_by (e.g. resampling by time windows) cannot run in that build.","triggerScenarios":"Executing a lazy plan containing a group_by_dynamic operation (group_by_dynamic / upsample / rolling by time) against a polars build compiled without the `dynamic_group_by` feature.","commonSituations":"Using a minimal/default polars build (e.g. a slim Docker image or a crate depending on polars-core without the feature) and calling .group_by_dynamic() or time-based resampling; distributions that strip optional features.","solutions":["Enable the feature in Cargo.toml: polars = { version = \"...\", features = [\"dynamic_group_by\"] } (usually via polars = { features = [\"lazy\", \"dynamic_group_by\"] }).","Use the full `polars` meta-crate with default features or `features = [\"full\"]`.","Rewrite the operation with plain group_by + expression-based date_trunc/windowing if you must stay feature-minimal.","Verify with `cargo tree -e features` that the feature actually reaches the final build."],"exampleFix":"// before (Cargo.toml)\npolars = { version = \"0.46\", features = [\"lazy\"] }\n// after\npolars = { version = \"0.46\", features = [\"lazy\", \"dynamic_group_by\"] }","handlingStrategy":"validation","validationCode":"// build-time check: ensure the feature is enabled in Cargo.toml\n// polars = { features = [\"dynamic_group_by\"] }\n// runtime check in code that uses group_by_dynamic:\n#[cfg(not(feature = \"dynamic_group_by\"))]\ncompile_error!(\"group_by_dynamic requires the polars 'dynamic_group_by' feature\");","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable 'dynamic_group_by' (or 'full') in any workspace that calls group_by_dynamic/upsample.","Check `cargo tree -e features` in CI to confirm the feature reaches the final binary.","Avoid disabling default features on polars unless you audit required features."],"tags":["cargo-feature","group-by","compile-time","panic"],"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"}