{"record":{"id":"9ad0828cfc7f7fea","repo":"pola-rs/polars","slug":"into-datetime-not-implemented-for-dt","errorCode":null,"errorMessage":"into_datetime not implemented for {dt:?}","messagePattern":"into_datetime not implemented for (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":984,"sourceCode":"            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:?}\"),\n        }\n    }\n\n    #[allow(unused_variables)]\n    pub fn into_duration(self, timeunit: TimeUnit) -> Series {\n        #[cfg(not(feature = \"dtype-duration\"))]\n        {\n            panic!(\"activate feature dtype-duration\")\n        }\n        #[cfg(feature = \"dtype-duration\")]\n        match self.dtype() {\n            DataType::Int64 => self\n                .i64()\n                .unwrap()\n                .clone()\n                .into_duration(timeunit)\n                .into_series(),\n            DataType::Duration(_) => self","sourceCodeStart":966,"sourceCodeEnd":1002,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-core/src/series/mod.rs#L966-L1002","documentation":"Series::into_datetime (with dtype-datetime enabled) accepts only Int64 physical values and Datetime series; any other dtype reaches the terminal panic naming it. E.g. calling into_datetime on an Int32 or Date series triggers it — cast to Int64 (microseconds) first.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"into_datetime not implemented for {dt:?}\". 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 (\"into_datetime not implemented for {dt:?}\"). 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":["Convert to Datetime only from supported dtypes (Date, Int64 timestamps, strings via strptime).","Cast the source series to Int64 with the correct time unit first."],"exampleFix":null,"handlingStrategy":"type-guard","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"}