{"record":{"id":"4aadc11e2653acf5","repo":"pola-rs/polars","slug":"not-implemented","errorCode":null,"errorMessage":"not implemented","messagePattern":"not implemented","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"critical","filePath":"crates/polars-arrow/src/array/builder.rs","lineNumber":379,"sourceCode":"                unreachable!()\n            };\n            Box::new(FixedSizeListArrayBuilder::new(\n                dtype.clone(),\n                make_builder(inner_dt.dtype()),\n            ))\n        },\n        Struct => {\n            let ArrowDataType::Struct(fields) = dtype else {\n                unreachable!()\n            };\n            let builders = fields.iter().map(|f| make_builder(f.dtype())).collect();\n            Box::new(StructArrayBuilder::new(dtype.clone(), builders))\n        },\n        BinaryView => Box::new(BinaryViewArrayGenericBuilder::<[u8]>::new(dtype.clone())),\n        Utf8View => Box::new(BinaryViewArrayGenericBuilder::<str>::new(dtype.clone())),\n\n        List | Binary | Utf8 | LargeUtf8 | Map | Union | Dictionary(_) => {\n            unimplemented!()\n        },\n    }\n}\n","sourceCodeStart":361,"sourceCodeEnd":383,"githubUrl":"https://github.com/pola-rs/polars/blob/df599052daf96e7a9cc30a3b0c6bd25d6947e3c0/crates/polars-arrow/src/array/builder.rs#L361-L383","documentation":"Panic (unimplemented!()) in polars-arrow's make_builder, which constructs an ArrayBuilder from an ArrowDataType. The physical-type match covers Null, Boolean, Primitive, LargeBinary, FixedSizeBinary, LargeList, FixedSizeList, Struct, BinaryView and Utf8View; requesting a builder for 32-bit List, Binary/Utf8/LargeUtf8 (non-view strings), Map, Union, or Dictionary dtypes panics with 'not implemented'. Polars internally standardizes on the view/large variants, so these dtypes reaching this function are unhandled by design.","triggerScenarios":"Any polars-arrow path that creates builders from an externally supplied Arrow schema containing e.g. ArrowDataType::Utf8, ArrowDataType::List, ArrowDataType::Dictionary(Int32, Utf8), or Map - e.g. concatenation/extend paths (CreateBuilder/make_builder recursion into LargeList inner dtypes also propagates the panic), or Series/DataFrame construction from arrow-rs record batches with those legacy dtypes via the Arrow C data interface.","commonSituations":"Ingesting Arrow IPC/Feather files or arrow-rs RecordBatches whose strings are Utf8 instead of Utf8View, or whose lists are 32-bit List; dictionaries/categoricals from other Arrow systems; interop layers (pyarrow <-> polars) on older polars versions; nesting (LargeList of Dictionary) hitting the inner make_builder call.","solutions":["Convert legacy dtypes before touching polars-arrow builders: Utf8/LargeUtf8 -> Utf8View (or LargeUtf8 where supported), Binary -> LargeBinary, List -> LargeList, Dictionary -> plain values or Categorical via polars-core.","Rechunk/convert in pyarrow first: `tbl.cast(target_schema)` with view/large types, or pass through polars' own interchange (pl.from_arrow) which normalizes dtypes.","If you control the producer, write Arrow IPC with view/large types (polars' default).","Upgrade polars - builder coverage grows across releases; if the panic persists, report the dtype combination upstream.","As a library author, avoid calling make_builder (or CreateBuilder) on unvalidated schemas; validate against the supported set first."],"exampleFix":"// before (Rust)\nlet b = polars_arrow::array::builder::make_builder(&ArrowDataType::Utf8); // panics\n\n// after\nlet dtype = ArrowDataType::Utf8View;\nlet b = polars_arrow::array::builder::make_builder(&dtype); // BinaryViewArrayGenericBuilder<str>","handlingStrategy":"validation","validationCode":"// Rust\nuse polars_arrow::datatypes::ArrowDataType;\nfn builder_supported(dt: &ArrowDataType) -> bool {\n    use ArrowDataType::*;\n    !matches!(dt, List(_) | Binary | Utf8 | LargeUtf8 | Map(_, _) | Union(_, _) | Dictionary(_, _))\n}\nassert!(builder_supported(dt), \"unsupported builder dtype: {dt:?}\");","typeGuard":"// Rust\nfn is_supported_builder_dtype(dt: &ArrowDataType) -> bool {\n    !matches!(dt, ArrowDataType::List(_) | ArrowDataType::Binary | ArrowDataType::Utf8 | ArrowDataType::LargeUtf8 | ArrowDataType::Map(_, _) | ArrowDataType::Union(_, _) | ArrowDataType::Dictionary(_, _))\n}","tryCatchPattern":"// Rust - last resort containment for a panic boundary\nlet result = std::panic::catch_unwind(|| make_builder(&dt));\nif result.is_err() {\n    // normalize dtype (Utf8->Utf8View, List->LargeList) and retry, or surface an error\n}","preventionTips":["Normalize external Arrow schemas to Polars-native variants (Utf8View, BinaryView, LargeList, LargeBinary) before interop.","When consuming arrow-rs/pyarrow data, cast legacy Utf8/List/Dictionary columns up front.","Validate nested dtypes recursively - LargeList inner dtypes go through make_builder again.","Track polars release notes: builder coverage expands over versions."],"tags":["polars","rust","polars-arrow","panic","builder","arrow","dtype","unimplemented"],"backgroundTag":null,"analyzedSha":"df599052daf96e7a9cc30a3b0c6bd25d6947e3c0","analyzedAt":"2026-08-16T12:10:03.978Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}