pola-rs/polars · error
multiple nested objects not yet supported
Error message
multiple nested objects not yet supported
What it means
drop_list in the object extension drop path walks the inner dtype of a ListChunked counting nesting levels; if the innermost type is an Object and nested_count != 0 (an object inside a list-of-list or deeper), it panics because dereferencing nested object pointers on drop is unsupported.
Source
Thrown at crates/polars-core/src/chunked_array/object/extension/drop.rs:16
use crate::chunked_array::object::extension::PolarsExtension;
use crate::prelude::*;
/// This will dereference a raw ptr when dropping the [`PolarsExtension`], make sure that it's valid.
pub(crate) unsafe fn drop_list(ca: &ListChunked) {
let mut inner = ca.inner_dtype();
let mut nested_count = 0;
while let Some(a) = inner.inner_dtype() {
nested_count += 1;
inner = a;
}
if matches!(inner, DataType::Object(_)) {
if nested_count != 0 {
panic!("multiple nested objects not yet supported")
}
for lst_arr in &ca.chunks {
if let ArrowDataType::LargeList(fld) = lst_arr.dtype() {
let dtype = fld.dtype();
assert!(matches!(dtype, ArrowDataType::Extension(_)));
// recreate the polars extension so that the content is dropped
let arr = lst_arr.as_any().downcast_ref::<LargeListArray>().unwrap();
let values = arr.values();
drop_object_array(values.as_ref())
}
}
}
}
pub(crate) unsafe fn drop_object_array(values: &dyn Array) {View on GitHub (pinned to 5d8ebabf11)
Solutions
- Flatten nested Object columns before the operation; only one level of object nesting is supported.
- Restructure the data so nested objects are stored as separate columns or serialized.
Defensive patterns
Strategy: fallback
When it happens
Trigger: This panic/expect fires when execution reaches an unguarded state described by: "multiple nested objects not yet supported". Typical triggers: unsupported dtype or feature-gated code path reached at runtime, invalid user input or environment variable value, calling API methods in the wrong order or on mismatched types, or data (lengths, offsets, ranges) violating the function's preconditions.
Common situations: Encountered when input data or configuration does not meet the preconditions of the throwing code path ("multiple nested objects not yet supported"). Common cases: missing Cargo feature flags, mismatched dtypes/lengths between arrays or series, out-of-range temporal values, malformed environment variables, or operations on unsupported/complex nested types.
AI-assisted analysis of pola-rs/polars@5d8ebabf11 (2026-08-28).
Data as JSON: /api/errors/d1c1a50f2114dd18.
Report an issue: GitHub.