pola-rs/polars · error

activate feature dynamic_group_by

Error message

activate feature dynamic_group_by

What it means

Feature-gate panic in the GroupByRollingExec executor: the rolling group-by IR node was built (implying the plan contains a rolling window) but the `dynamic_group_by` cargo feature was compiled out, so no implementation exists for this node in this build.

Source

Thrown at crates/polars-mem-engine/src/executors/group_by_rolling.rs:118

                *k = k.slice(offset, len);
            }
        }

        let agg_columns = evaluate_aggs(&df, &self.aggs, groups, state)?;

        let mut columns = Vec::with_capacity(agg_columns.len() + 1 + keys.len());
        columns.extend_from_slice(&keys);
        columns.push(time_key);
        columns.extend(agg_columns);

        DataFrame::new_infer_height(columns)
    }
}

impl Executor for GroupByRollingExec {
    #[cfg(not(feature = "dynamic_group_by"))]
    fn execute(&mut self, _state: &mut ExecutionState) -> PolarsResult<DataFrame> {
        panic!("activate feature dynamic_group_by")
    }

    #[cfg(feature = "dynamic_group_by")]
    fn execute(&mut self, state: &mut ExecutionState) -> PolarsResult<DataFrame> {
        state.should_stop()?;
        #[cfg(debug_assertions)]
        {
            if state.verbose() {
                eprintln!("run GroupbyRollingExec")
            }
        }
        let df = self.input.execute(state)?;
        self.execute_impl(state, df)
    }
}

View on GitHub (pinned to 5d8ebabf11)

Solutions

  1. Enable the `dynamic_group_by` cargo feature to use rolling/dynamic group-by.
  2. Use a static group-by over a computed time bucket column as an alternative.
Defensive patterns

Strategy: fallback

When it happens

Trigger: This panic/expect fires when execution reaches an unguarded state described by: "activate feature dynamic_group_by". 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 feature dynamic_group_by"). 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@5d8ebabf11 (2026-08-19). Data as JSON: /api/errors/a9a85f7fbfdc00e6. Report an issue: GitHub.