{"record":{"id":"c91be92cbc0044b9","repo":"pola-rs/polars","slug":"activate-the-dtype-struct-feature-to-handle-stru","errorCode":null,"errorMessage":"activate the 'dtype-struct' feature to handle struct data types","messagePattern":"activate the 'dtype-struct' feature to handle struct data types","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-core/src/datatypes/field.rs","lineNumber":259,"sourceCode":"                    );\n                    DataType::from_categories(cats)\n                } else if matches!(\n                    value_type.as_ref(),\n                    ArrowDataType::Utf8 | ArrowDataType::LargeUtf8 | ArrowDataType::Utf8View\n                ) {\n                    DataType::from_categories(Categories::global())\n                } else {\n                    Self::from_arrow(value_type, None)\n                }\n            },\n\n            #[cfg(feature = \"dtype-struct\")]\n            ArrowDataType::Struct(fields) => {\n                DataType::Struct(fields.iter().map(|fld| fld.into()).collect())\n            },\n            #[cfg(not(feature = \"dtype-struct\"))]\n            ArrowDataType::Struct(_) => {\n                panic!(\"activate the 'dtype-struct' feature to handle struct data types\")\n            },\n            ArrowDataType::Extension(ext) if ext.name.as_str() == POLARS_OBJECT_EXTENSION_NAME => {\n                #[cfg(feature = \"object\")]\n                {\n                    DataType::Object(\"object\")\n                }\n                #[cfg(not(feature = \"object\"))]\n                {\n                    panic!(\"activate the 'object' feature to be able to load POLARS_EXTENSION_TYPE\")\n                }\n            },\n            #[cfg(feature = \"dtype-extension\")]\n            ArrowDataType::Extension(ext) => {\n                use crate::prelude::extension::get_extension_type_or_storage;\n                let storage = DataType::from_arrow(&ext.inner, md);\n                match get_extension_type_or_storage(&ext.name, &storage, ext.metadata.as_deref()) {\n                    Some(typ) => DataType::Extension(typ, Box::new(storage)),\n                    None => storage,","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/pola-rs/polars/blob/68506541d2de983056c9eb244e1ea05fab377dfc/crates/polars-core/src/datatypes/field.rs#L241-L277","documentation":"Field/DataType::from_arrow conversion of ArrowDataType::Struct is compiled only with the 'dtype-struct' feature; without it the match falls to the panic telling you to activate the feature when a struct-typed Arrow field is imported (e.g. from an IPC/Arrow file).","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"activate the 'dtype-struct' feature to handle struct data types\". 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.","commonSituations":"Encountered when input data or configuration does not meet the preconditions of the throwing code path (\"activate the 'dtype-struct' feature to handle struct data types\"). 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.","solutions":["Enable the `dtype-struct` cargo feature to work with struct data types.","Avoid struct columns (flatten them into separate columns) if the feature cannot be enabled."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"68506541d2de983056c9eb244e1ea05fab377dfc","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}