pola-rs/polars · critical
not implemented
Error message
not implemented
What it means
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.
Source
Thrown at crates/polars-arrow/src/array/builder.rs:379
unreachable!()
};
Box::new(FixedSizeListArrayBuilder::new(
dtype.clone(),
make_builder(inner_dt.dtype()),
))
},
Struct => {
let ArrowDataType::Struct(fields) = dtype else {
unreachable!()
};
let builders = fields.iter().map(|f| make_builder(f.dtype())).collect();
Box::new(StructArrayBuilder::new(dtype.clone(), builders))
},
BinaryView => Box::new(BinaryViewArrayGenericBuilder::<[u8]>::new(dtype.clone())),
Utf8View => Box::new(BinaryViewArrayGenericBuilder::<str>::new(dtype.clone())),
List | Binary | Utf8 | LargeUtf8 | Map | Union | Dictionary(_) => {
unimplemented!()
},
}
}
View on GitHub (pinned to df599052da)
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.
Example fix
// before (Rust) let b = polars_arrow::array::builder::make_builder(&ArrowDataType::Utf8); // panics // after let dtype = ArrowDataType::Utf8View; let b = polars_arrow::array::builder::make_builder(&dtype); // BinaryViewArrayGenericBuilder<str>
Defensive patterns
Strategy: validation
Validate before calling
// Rust
use polars_arrow::datatypes::ArrowDataType;
fn builder_supported(dt: &ArrowDataType) -> bool {
use ArrowDataType::*;
!matches!(dt, List(_) | Binary | Utf8 | LargeUtf8 | Map(_, _) | Union(_, _) | Dictionary(_, _))
}
assert!(builder_supported(dt), "unsupported builder dtype: {dt:?}"); Type guard
// Rust
fn is_supported_builder_dtype(dt: &ArrowDataType) -> bool {
!matches!(dt, ArrowDataType::List(_) | ArrowDataType::Binary | ArrowDataType::Utf8 | ArrowDataType::LargeUtf8 | ArrowDataType::Map(_, _) | ArrowDataType::Union(_, _) | ArrowDataType::Dictionary(_, _))
} Try / catch
// Rust - last resort containment for a panic boundary
let result = std::panic::catch_unwind(|| make_builder(&dt));
if result.is_err() {
// normalize dtype (Utf8->Utf8View, List->LargeList) and retry, or surface an error
} Prevention
- 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.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- not implemented
- horizontal_flatten not supported for data type {:?}
- can not get dtype of Categorical AnyValue
- can not get dtype of Enum AnyValue
- Deserialization from JSON not implemented for {adt:?}
AI-assisted analysis of pola-rs/polars@df599052da (2026-08-16).
Data as JSON: /api/errors/4aadc11e2653acf5.
Report an issue: GitHub.