{"record":{"id":"a987d1c89280dfe2","repo":"pola-rs/polars","slug":"activate-dtype-array","errorCode":null,"errorMessage":"activate 'dtype-array'","messagePattern":"activate 'dtype-array'","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-arrow/src/array/static_array_collect.rs","lineNumber":860,"sourceCode":"        {\n            let ArrowDataType::FixedSizeList(_, width) = &dtype else {\n                panic!(\"FixedSizeListArray::arr_from_iter_with_dtype called with non-Array dtype\");\n            };\n            let iter_values: Vec<_> = iter.into_iter().collect();\n            let mut builder = AnonymousFixedSizeListArrayBuilder::new(iter_values.len(), *width);\n            for arr in iter_values {\n                match arr {\n                    Some(a) => builder.push(a.into_boxed_array()),\n                    None => builder.push_null(),\n                }\n            }\n            let inner = dtype\n                .inner_dtype()\n                .expect(\"expected nested type in ListArray collect\");\n            builder.finish(&inner.underlying_physical_type()).unwrap()\n        }\n        #[cfg(not(feature = \"dtype-array\"))]\n        panic!(\"activate 'dtype-array'\")\n    }\n\n    fn try_arr_from_iter_with_dtype<\n        E,\n        I: IntoIterator<Item = Result<Option<Box<dyn Array>>, E>>,\n    >(\n        dtype: ArrowDataType,\n        iter: I,\n    ) -> Result<Self, E> {\n        let iter_values = iter.into_iter().collect::<Result<Vec<_>, E>>()?;\n        Ok(Self::arr_from_iter_with_dtype(dtype, iter_values))\n    }\n}\n\nimpl ArrayFromIter<Option<()>> for StructArray {\n    fn arr_from_iter<I: IntoIterator<Item = Option<()>>>(_iter: I) -> Self {\n        no_call_const!()\n    }","sourceCodeStart":842,"sourceCodeEnd":878,"githubUrl":"https://github.com/pola-rs/polars/blob/fe841f959ef4d2ceefc05a310d33ed7b1ab24e5e/crates/polars-arrow/src/array/static_array_collect.rs#L842-L878","documentation":"This panic fires from the `Box<dyn Array>` FromIterator-with-dtype impl for list-like arrays when the crate was compiled without the `dtype-array` Cargo feature. Collecting into a FixedSizeListArray (the ArrayCollectNamespace path that materializes nested list physical types) is only implemented when that feature is active, so the un-supported build deliberately panics instead of silently producing wrong results.","triggerScenarios":"Calling an API that collects an iterator into an array with an explicit nested dtype (e.g. `arr.collect_arr_with_dtype` targeting a FixedSizeList/FixedShapeList type) on a polars-arrow build lacking the `dtype-array` feature.","commonSituations":"Users enable `lazy` or `dtype-array`-dependent Polars features in their own crates but polars-arrow is pulled in transitively with default features; a Cargo feature-unification change or a minimal-features build drops the flag and a code path that previously worked starts panicking at runtime.","solutions":["Enable the `dtype-array` feature on the polars/polars-arrow dependency in Cargo.toml (e.g. `polars = { version = \"...\", features = [\"dtype-array\"] }`).","Run `cargo tree -i polars-arrow` to confirm which feature graph is being built and ensure no `default-features = false` setting strips the feature.","If you control the call site, avoid the FixedSizeList collect path (or gate it behind `#[cfg(feature = \"dtype-array\")]`) so the panic branch is unreachable.","Upgrade polars to a version where the needed collect impl is available under your feature set."],"exampleFix":"// before (Cargo.toml)\npolars = { version = \"0.40\", default-features = false, features = [\"lazy\"] }\n// after\npolars = { version = \"0.40\", default-features = false, features = [\"lazy\", \"dtype-array\"] }","handlingStrategy":"validation","validationCode":"// Cargo.toml check (build-time guard)\n#[cfg(not(feature = \"dtype-array\"))]\ncompile_error!(\"this code requires the polars 'dtype-array' feature\");\n// runtime guard before collect:\nassert!(matches!(dtype.to_storage(), ArrowDataType::FixedSizeList(_, _)) && cfg!(feature = \"dtype-array\"));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Declare all polars features you depend on explicitly in Cargo.toml","Use `cargo tree -e features` to audit which features reach polars-arrow","Pin feature sets in CI to catch feature-unification regressions"],"tags":["rust","feature-flags","arrow","cargo"],"backgroundTag":"feature-not-enabled","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"}