{"record":{"id":"a77ba448096b340a","repo":"pola-rs/polars","slug":"not-implemented-a77ba4","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-arrow/src/io/ipc/write/schema.rs","lineNumber":279,"sourceCode":"        })),\n        Time32(unit) => ipc::Type::Time(Box::new(ipc::Time {\n            unit: serialize_time_unit(unit),\n            bit_width: 32,\n        })),\n        Time64(unit) => ipc::Type::Time(Box::new(ipc::Time {\n            unit: serialize_time_unit(unit),\n            bit_width: 64,\n        })),\n        Timestamp(unit, tz) => ipc::Type::Timestamp(Box::new(ipc::Timestamp {\n            unit: serialize_time_unit(unit),\n            timezone: tz.as_ref().map(|x| x.to_string()),\n        })),\n        Interval(unit) => ipc::Type::Interval(Box::new(ipc::Interval {\n            unit: match unit {\n                IntervalUnit::YearMonth => ipc::IntervalUnit::YearMonth,\n                IntervalUnit::DayTime => ipc::IntervalUnit::DayTime,\n                IntervalUnit::MonthDayNano => ipc::IntervalUnit::MonthDayNano,\n                IntervalUnit::MonthDayMillis => unimplemented!(),\n            },\n        })),\n        List(_) => ipc::Type::List(Box::new(ipc::List {})),\n        LargeList(_) => ipc::Type::LargeList(Box::new(ipc::LargeList {})),\n        FixedSizeList(_, size) => ipc::Type::FixedSizeList(Box::new(ipc::FixedSizeList {\n            list_size: *size as i32,\n        })),\n        Union(u) => ipc::Type::Union(Box::new(ipc::Union {\n            mode: match u.mode {\n                UnionMode::Dense => ipc::UnionMode::Dense,\n                UnionMode::Sparse => ipc::UnionMode::Sparse,\n            },\n            type_ids: u.ids.clone(),\n        })),\n        Map(_, keys_sorted) => ipc::Type::Map(Box::new(ipc::Map {\n            keys_sorted: *keys_sorted,\n        })),\n        Struct(_) => ipc::Type::Struct(Box::new(ipc::Struct {})),","sourceCodeStart":261,"sourceCodeEnd":297,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/crates/polars-arrow/src/io/ipc/write/schema.rs#L261-L297","documentation":"serialize_type maps ArrowDataType to the IPC flatbuffer type when writing Feather V2/Arrow IPC files. The Arrow IPC spec defines only YearMonth, DayTime and MonthDayNano interval units; polars' extra MonthDayMillis unit has no wire representation, and its arm (crates/polars-arrow/src/io/ipc/write/schema.rs:279) is unimplemented!(). Writing a dataset containing Interval(MonthDayMillis) panics during schema serialization, before any data is flushed.","triggerScenarios":"An IPC/Feather write (the WriteOptions path) of a column typed Interval(IntervalUnit::MonthDayMillis), regardless of compression settings.","commonSituations":"Persisting interval columns produced by legacy polars versions or interop that mapped to MonthDayMillis; re-saving cached/intermediate files after a version bump.","solutions":["Cast the interval column to MonthDayNano before writing","Cast to Duration or Utf8 if nanosecond intervals are unwanted","Guard the schema on the write path and report the offending column name","Upstream: reject with a PolarsResult error instead of panicking"],"exampleFix":"// before\nwrite_file(&mut df, path, WriteOptions { compression: Some(CompressionCodec::Zstd) })?; // panics in serialize_type\n\n// after\nlet df = df.with_column(col(\"iv\").cast(DataType::Interval(IntervalUnit::MonthDayNano)))?;\nwrite_file(&mut df, path, WriteOptions { compression: Some(CompressionCodec::Zstd) })?;","handlingStrategy":"type-guard","validationCode":"for (name, dtype) in df.schema().iter() {\n    polars_ensure!(\n        !matches!(dtype, ArrowDataType::Interval(IntervalUnit::MonthDayMillis)),\n        ComputeError: \"column '{}' is Interval(MonthDayMillis); cast to MonthDayNano before IPC write\", name\n    );\n}","typeGuard":"fn ipc_writable_intervals(dtype: &ArrowDataType) -> bool {\n    !matches!(dtype, ArrowDataType::Interval(IntervalUnit::MonthDayMillis))\n}","tryCatchPattern":null,"preventionTips":["Standardize interval columns on MonthDayNano before any persistence step","Add a pre-write schema gate to batch/file writers","Version your cached IPC files and re-encode on upgrade"],"tags":["rust","polars-arrow","ipc","feather","interval","write","panic"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}