{"record":{"id":"dfe2575759f8ba8a","repo":"pola-rs/polars","slug":"activate-feature-dtype-datetime","errorCode":null,"errorMessage":"activate feature dtype-datetime","messagePattern":"activate feature dtype-datetime","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":966,"sourceCode":"        #[cfg(feature = \"dtype-date\")]\n        match self.dtype() {\n            DataType::Int32 => self.i32().unwrap().clone().into_date().into_series(),\n            DataType::Date => self\n                .date()\n                .unwrap()\n                .physical()\n                .clone()\n                .into_date()\n                .into_series(),\n            dt => panic!(\"date not implemented for {dt:?}\"),\n        }\n    }\n\n    #[allow(unused_variables)]\n    pub fn into_datetime(self, timeunit: TimeUnit, tz: Option<TimeZone>) -> Series {\n        #[cfg(not(feature = \"dtype-datetime\"))]\n        {\n            panic!(\"activate feature dtype-datetime\")\n        }\n\n        #[cfg(feature = \"dtype-datetime\")]\n        match self.dtype() {\n            DataType::Int64 => self\n                .i64()\n                .unwrap()\n                .clone()\n                .into_datetime(timeunit, tz)\n                .into_series(),\n            DataType::Datetime(_, _) => self\n                .datetime()\n                .unwrap()\n                .physical()\n                .clone()\n                .into_datetime(timeunit, tz)\n                .into_series(),\n            dt => panic!(\"into_datetime not implemented for {dt:?}\"),","sourceCodeStart":948,"sourceCodeEnd":984,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-core/src/series/mod.rs#L948-L984","documentation":"Series::into_datetime requires the 'dtype-datetime' cargo feature; when the crate is built without it, the guard panics immediately regardless of the series' dtype. This is a compile-time feature flag error — rebuild with the feature enabled.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"activate feature dtype-datetime\". 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.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"activate feature dtype-datetime\"). 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.","solutions":["Enable the `dtype-datetime` cargo feature to use Datetime dtype.","Store timestamps as Int64 with an explicit unit if the feature cannot be enabled."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}