{"record":{"id":"c538dab15cf4075d","repo":"pola-rs/polars","slug":"activate-feature-dtype-duration","errorCode":null,"errorMessage":"activate feature dtype-duration","messagePattern":"activate feature dtype-duration","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":992,"sourceCode":"                .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\n                .duration()\n                .unwrap()\n                .physical()\n                .clone()\n                .into_duration(timeunit)\n                .into_series(),\n            dt => panic!(\"into_duration not implemented for {dt:?}\"),\n        }","sourceCodeStart":974,"sourceCodeEnd":1010,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-core/src/series/mod.rs#L974-L1010","documentation":"Series::into_duration is gated behind the 'dtype-duration' cargo feature; without it the function panics with this message at call time. A build-configuration error resolved by enabling the feature when compiling polars.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"activate feature dtype-duration\". 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-duration\"). 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-duration` cargo feature to use Duration dtype.","Represent durations as Int64 in a fixed time 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-14T00:17:10.932Z"}