{"record":{"id":"a7edf05cf7b190ac","repo":"pola-rs/polars","slug":"activate-feature-dtype-struct","errorCode":null,"errorMessage":"activate feature 'dtype-struct'","messagePattern":"activate feature 'dtype-struct'","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-plan/src/plans/functions/schema.rs","lineNumber":87,"sourceCode":"                                DataType::Unknown(_) => {\n                                    // pass through unknown\n                                },\n                                _ => {\n                                    polars_bail!(\n                                        SchemaMismatch: \"expected struct dtype, got: `{}`\", dtype\n                                    );\n                                },\n                            }\n                        } else {\n                            new_schema.with_column(name.clone(), dtype.clone());\n                        }\n                    }\n\n                    Ok(Cow::Owned(Arc::new(new_schema)))\n                }\n                #[cfg(not(feature = \"dtype-struct\"))]\n                {\n                    panic!(\"activate feature 'dtype-struct'\")\n                }\n            },\n            RowIndex { schema, name, .. } => Ok(Cow::Owned(row_index_schema(\n                schema,\n                input_schema,\n                name.clone(),\n            ))),\n            Explode {\n                schema,\n                options: _,\n                columns,\n            } => explode_schema(schema, input_schema, columns),\n            #[cfg(feature = \"pivot\")]\n            Unpivot { schema, args } => unpivot_schema(args, schema, input_schema),\n            Hint(_) => Ok(Cow::Borrowed(input_schema)),\n        }\n    }\n}","sourceCodeStart":69,"sourceCodeEnd":105,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-plan/src/plans/functions/schema.rs#L69-L105","documentation":"Panic/feature gate in the python function schema inference path: handling struct-typed fields requires the dtype-struct cargo feature, which is disabled in this build. Rebuild with dtype-struct enabled or avoid struct dtypes in this UDF signature.","triggerScenarios":"This panic/expect fires when execution reaches an unguarded state described by: \"activate feature 'dtype-struct'\". 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 feature 'dtype-struct'\"). 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 for struct support in the plan/schema layer.","Flatten struct columns into separate columns if the feature cannot be enabled."],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}