{"record":{"id":"83d38bc53e83bd0a","repo":"pola-rs/polars","slug":"writing-to-parquet-not-yet-implemented","errorCode":null,"errorMessage":"Writing {:?} to parquet not yet implemented","messagePattern":"Writing (.+?) to parquet not yet implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-parquet/src/arrow/write/pages.rs","lineNumber":526,"sourceCode":"                    &mut array_stack,\n                );\n            },\n            P::Null\n            | P::Boolean\n            | P::Primitive(_)\n            | P::Binary\n            | P::FixedSizeBinary\n            | P::LargeBinary\n            | P::Utf8\n            | P::LargeUtf8\n            | P::Dictionary(_)\n            | P::BinaryView\n            | P::Utf8View\n            | P::Struct => {\n                leaves.push(array.with_validity(validity.into()));\n            },\n\n            other => todo!(\"Writing {:?} to parquet not yet implemented\", other),\n        }\n    }\n}\n\n/// Convert `ParquetType` to `Vec<ParquetPrimitiveType>` leaves in DFS order.\npub fn to_parquet_leaves(type_: ParquetType) -> Vec<ParquetPrimitiveType> {\n    let mut leaves = vec![];\n    to_parquet_leaves_recursive(type_, &mut leaves);\n    leaves\n}\n\nfn to_parquet_leaves_recursive(type_: ParquetType, leaves: &mut Vec<ParquetPrimitiveType>) {\n    match type_ {\n        ParquetType::PrimitiveType(primitive) => leaves.push(primitive),\n        ParquetType::GroupType { fields, .. } => {\n            fields\n                .into_iter()\n                .for_each(|type_| to_parquet_leaves_recursive(type_, leaves));","sourceCodeStart":508,"sourceCodeEnd":544,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-parquet/src/arrow/write/pages.rs#L508-L544","documentation":"todo!() in the parquet page writer's array-to-columns conversion: an Arrow array dtype reached the writer that has no parquet encoding implemented. The wildcard match arm reports the offending dtype instead of silently dropping data.","triggerScenarios":"Calling write_parquet / SinkTrait parquet sink on a frame containing an array dtype (e.g. Array/FixedSizeList, or other unhandled P::* variants) not supported by the writer.","commonSituations":"Writing fixed-size list/Array columns built with arr.* namespace to parquet; dataframes ingested from backends producing exotic dtypes; hitting an unported type after a polars upgrade.","solutions":["Cast unsupported columns before writing, e.g. arr.cast(List) or to a supported type","Drop or restructure columns containing unsupported dtypes","Upgrade polars; unimplemented writer branches are added over time","File an issue with the dtype printed in the message if it should be supported"],"exampleFix":"// before\ndf.write_parquet(path)?; // df has FixedSizeList column\n// after\nlet df = df.with_column(col(\"arr\").cast(DataType::List(Box::new(inner))))?;\ndf.write_parquet(path)?;","handlingStrategy":"validation","validationCode":"// Rust: reject unsupported dtypes before sink\nfor (name, dtype) in df.get_column_names_str().zip(df.dtypes()) {\n    if matches!(dtype, DataType::Array(_, _)) {\n        return Err(format!(\"cast or drop column {name}: {:?} unsupported by parquet writer\", dtype));\n    }\n}","typeGuard":null,"tryCatchPattern":"std::panic::catch_unwind(|| df.write_parquet(path));","preventionTips":["Audit dtypes (df.schema) before parquet sinks","Cast Array/FixedSizeList columns to List or Struct first","Upgrade polars when new dtypes appear"],"tags":["parquet","unsupported-dtype","writer","todo"],"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"}