{"record":{"id":"4335c26994433273","repo":"pola-rs/polars","slug":"activate-feature-dtype-date","errorCode":null,"errorMessage":"activate feature dtype-date","messagePattern":"activate feature dtype-date","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/series/mod.rs","lineNumber":959,"sourceCode":"    #[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(),\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\"))]","sourceCodeStart":941,"sourceCodeEnd":977,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-core/src/series/mod.rs#L941-L977","documentation":"Series::into_date is compiled out when the dtype-date feature is disabled; calling it panics with a reminder to rebuild polars with the dtype-date feature enabled, since Date dtype support is feature-gated.","triggerScenarios":"Calling into_date() (directly or via finish_cast when casting to Date) on a build compiled without the dtype-date feature.","commonSituations":"Minimal polars builds with default-features = false; casting Int32 day-since-epoch columns to Date in a slim build.","solutions":["Add the feature: polars = { version = \"...\", features = [\"dtype-date\"] }","Enable 'temporal' or 'default' feature sets which include dtype-date","Keep the column as Int32 and do date math manually if you must stay feature-slim"],"exampleFix":"// before\npolars = { version = \"0.40\", default-features = false }\n// after\npolars = { version = \"0.40\", default-features = false, features = [\"dtype-date\"] }","handlingStrategy":"validation","validationCode":"#[cfg(not(feature = \"dtype-date\"))]\ncompile_error!(\"polars 'dtype-date' feature required\");","typeGuard":null,"tryCatchPattern":"let d: PolarsResult<Series> = series.strict_cast(&DataType::Date);","preventionTips":["List dtype-date explicitly when using default-features = false","Enable 'temporal' bundle for date/time/datetime features","Compile-check feature combos in CI"],"tags":["polars","rust","cargo-features","feature-gate","date"],"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"}