{"record":{"id":"3e82b8d7404a26c6","repo":"pola-rs/polars","slug":"activate-product-feature","errorCode":null,"errorMessage":"activate 'product' feature","messagePattern":"activate 'product' feature","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":914,"sourceCode":"                UInt64 => Ok(self.u64().unwrap().prod_reduce()),\n                #[cfg(feature = \"dtype-i128\")]\n                Int128 => Ok(self.i128().unwrap().prod_reduce()),\n                #[cfg(feature = \"dtype-u128\")]\n                UInt128 => Ok(self.u128().unwrap().prod_reduce()),\n                #[cfg(feature = \"dtype-f16\")]\n                Float16 => Ok(self.f16().unwrap().prod_reduce()),\n                Float32 => Ok(self.f32().unwrap().prod_reduce()),\n                Float64 => Ok(self.f64().unwrap().prod_reduce()),\n                #[cfg(feature = \"dtype-decimal\")]\n                Decimal(..) => Ok(self.decimal().unwrap().prod_reduce()),\n                dt => {\n                    polars_bail!(InvalidOperation: \"`product` operation not supported for dtype `{dt}`\")\n                },\n            }\n        }\n        #[cfg(not(feature = \"product\"))]\n        {\n            panic!(\"activate 'product' feature\")\n        }\n    }\n\n    /// Cast throws an error if conversion had overflows\n    pub fn strict_cast(&self, dtype: &DataType) -> PolarsResult<Series> {\n        self.cast_with_options(dtype, CastOptions::Strict)\n    }\n\n    #[cfg(feature = \"dtype-decimal\")]\n    pub fn into_decimal(self, precision: usize, scale: usize) -> PolarsResult<Series> {\n        match self.dtype() {\n            DataType::Int128 => Ok(self\n                .i128()\n                .unwrap()\n                .clone()\n                .into_decimal(precision, scale)?\n                .into_series()),\n            DataType::Decimal(cur_prec, cur_scale)","sourceCodeStart":896,"sourceCodeEnd":932,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-core/src/series/mod.rs#L896-L932","documentation":"Series::product is only compiled when the 'product' feature is enabled; without it the method body immediately panics with a directive to activate the feature. The multiplication-reduction implementation is feature-gated in polars-core.","triggerScenarios":"Calling series.product() (or APIs that reduce via product) on a polars build compiled without the 'product' cargo feature.","commonSituations":"Using a minimal-feature polars build (e.g. from a workspace that trimmed default features) and then calling cumulative/aggregate product operations.","solutions":["Add the 'product' feature to your polars dependency: polars = { version = \"...\", features = [\"product\"] }","Replace product() with an equivalent fold/multiplication over the column values if you cannot change features","Enable the broader 'lazy' or 'default' feature sets that include 'product'"],"exampleFix":"// before\npolars = { version = \"0.40\", default-features = false }\n// after\npolars = { version = \"0.40\", default-features = false, features = [\"product\"] }","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"product\"))]\ncompile_error!(\"polars 'product' feature required\");","typeGuard":null,"tryCatchPattern":"// gate at runtime\nlet prod = if cfg!(feature = \"product\") { Some(s.product()) } else { None };","preventionTips":["Check Cargo features when trimming polars default-features","Add a compile_error! guard for required polars features","Prefer 'default' or 'lazy' feature bundles for general workloads"],"tags":["polars","rust","cargo-features","feature-gate"],"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"}