{"record":{"id":"f59ee5963d703db3","repo":"pola-rs/polars","slug":"date-not-implemented-for-dt","errorCode":null,"errorMessage":"date not implemented for {dt:?}","messagePattern":"date not implemented for (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":952,"sourceCode":"            {\n                Ok(self)\n            },\n            dt => panic!(\"into_decimal({precision:?}, {scale}) not implemented for {dt:?}\"),\n        }\n    }\n\n    #[cfg(feature = \"dtype-time\")]\n    pub fn into_time(self) -> Series {\n        match self.dtype() {\n            DataType::Int64 => self.i64().unwrap().clone().into_time().into_series(),\n            DataType::Time => self\n                .time()\n                .unwrap()\n                .physical()\n                .clone()\n                .into_time()\n                .into_series(),\n            dt => panic!(\"date not implemented for {dt:?}\"),\n        }\n    }\n\n    pub fn into_date(self) -> Series {\n        #[cfg(not(feature = \"dtype-date\"))]\n        {\n            panic!(\"activate feature dtype-date\")\n        }\n        #[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(),","sourceCodeStart":934,"sourceCodeEnd":970,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-core/src/series/mod.rs#L934-L970","documentation":"Series::into_time only supports conversion from Int64 physical values or an existing Time dtype; any other dtype (e.g. Date, Datetime, Utf8) hits the catch-all panic — this conversion path simply does not implement a cast from that dtype to Time.","triggerScenarios":"Calling into_time() on a series whose dtype is neither Int64 nor DataType::Time (e.g. Int32, Datetime, String).","commonSituations":"Attempting to reinterpret datetime or string columns as Time directly; feature dtype-time enabled but the column was parsed as Int32 microseconds instead of Int64 nanos.","solutions":["Ensure the column is Int64 physical nanoseconds (cast first: .cast(&DataType::Int64)) before into_time()","Use the safe cast API: series.strict_cast(&DataType::Time) instead of into_time","Parse strings into time with str.to_time (temporal namespace) rather than into_time"],"exampleFix":"// before\nlet s = series.into_time(); // panics for Int32\n// after\nlet s = series.cast(&DataType::Int64)?.into_time();","handlingStrategy":"type-guard","validationCode":"if !matches!(s.dtype(), DataType::Int64 | DataType::Time) { /* convert first */ }","typeGuard":"fn time_convertible(dt: &DataType) -> bool { matches!(dt, DataType::Int64 | DataType::Time) }","tryCatchPattern":"let s: PolarsResult<Series> = series.strict_cast(&DataType::Time);","preventionTips":["Check the physical dtype (Int64 nanos) expected by temporal converters","Convert strings/datetime to time via the dt namespace, not into_time","Enable dtype-time and test temporal casts in CI"],"tags":["polars","rust","panic","time","dtype"],"backgroundTag":"unsupported-dtype","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"}