{"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":821,"sourceCode":"        #[cfg(feature = \"dtype-array\")]\n        {\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                builder.push(arr.into_boxed_array());\n            }\n            let inner = dtype\n                .inner_dtype()\n                .expect(\"expected nested type in ListArray collect\");\n            builder\n                .finish(Some(&inner.underlying_physical_type()))\n                .unwrap()\n        }\n        #[cfg(not(feature = \"dtype-array\"))]\n        panic!(\"activate 'dtype-array'\")\n    }\n\n    fn try_arr_from_iter_with_dtype<E, I: IntoIterator<Item = Result<Box<dyn Array>, E>>>(\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 ArrayFromIterDtype<Option<Box<dyn Array>>> for FixedSizeListArray {\n    #[allow(unused_variables)]\n    fn arr_from_iter_with_dtype<I: IntoIterator<Item = Option<Box<dyn Array>>>>(\n        dtype: ArrowDataType,\n        iter: I,\n    ) -> Self {\n        #[cfg(feature = \"dtype-array\")]","sourceCodeStart":803,"sourceCodeEnd":839,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-arrow/src/array/static_array_collect.rs#L803-L839","documentation":"This panic is a deliberate guard: FixedSizeListArray::arr_from_iter_with_dtype still compiles when polars-arrow is built without the dtype-array feature, but the fixed-width machinery behind it is feature-gated, so the cfg(not(feature = \"dtype-array\")) body just panics with 'activate 'dtype-array''.","triggerScenarios":"Calling any collect-into-FixedSizeListArray path (arr_from_iter_with_dtype / try_arr_from_iter_with_dtype) in a build of polars-arrow whose resolved Cargo features do not include dtype-array — e.g. depending on polars-arrow with default-features = false.","commonSituations":"A new crate adds polars-arrow with default features only; Cargo feature unification resolves polars-arrow without dtype-array because another dependency requested a reduced build; a polars upgrade split the feature out and the pin no longer enables it.","solutions":["Add features = [\"dtype-array\"] to the polars-arrow (or polars) dependency in Cargo.toml","Make sure the crate that actually calls the collect API — not merely a transitive one — enables the feature","Verify the resolved build with cargo tree -e features -i polars-arrow | grep dtype-array"],"exampleFix":"# before\npolars-arrow = \"0.5\"\n\n# after\npolars-arrow = { version = \"0.5\", features = [\"dtype-array\"] }","handlingStrategy":"validation","validationCode":"# Cargo.toml — the crate calling the API must enable the feature:\n[dependencies]\npolars-arrow = { version = \"0.5\", features = [\"dtype-array\"] }\n\n# verify the resolved build actually carries it:\n# cargo tree -e features -i polars-arrow | grep dtype-array","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Enable dtype-array in every crate that calls fixed-size-list collect paths","After dependency upgrades, re-check feature resolution with cargo tree -e features","Add a smoke test that builds one FixedSizeListArray so a missing feature fails in CI, not production"],"tags":["rust","polars","arrow","cargo","feature-flag","fixed-size-list"],"backgroundTag":"missing-feature-flag","analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}