pola-rs/polars · error

activate the 'object' feature to be able to load POLARS_EXTE

Error message

activate the 'object' feature to be able to load POLARS_EXTENSION_TYPE

What it means

When converting an Arrow extension array whose name is POLARS_OBJECT_EXTENSION_NAME, Field::from_arrow requires the 'object' cargo feature to reconstruct the Polars Object dtype; builds without it panic with this message. Enable the 'object' feature or avoid object-dtype data.

Source

Thrown at crates/polars-core/src/datatypes/field.rs:268

                }
            },

            #[cfg(feature = "dtype-struct")]
            ArrowDataType::Struct(fields) => {
                DataType::Struct(fields.iter().map(|fld| fld.into()).collect())
            },
            #[cfg(not(feature = "dtype-struct"))]
            ArrowDataType::Struct(_) => {
                panic!("activate the 'dtype-struct' feature to handle struct data types")
            },
            ArrowDataType::Extension(ext) if ext.name.as_str() == POLARS_OBJECT_EXTENSION_NAME => {
                #[cfg(feature = "object")]
                {
                    DataType::Object("object")
                }
                #[cfg(not(feature = "object"))]
                {
                    panic!("activate the 'object' feature to be able to load POLARS_EXTENSION_TYPE")
                }
            },
            #[cfg(feature = "dtype-extension")]
            ArrowDataType::Extension(ext) => {
                use crate::prelude::extension::get_extension_type_or_storage;
                let storage = DataType::from_arrow(&ext.inner, md);
                match get_extension_type_or_storage(&ext.name, &storage, ext.metadata.as_deref()) {
                    Some(typ) => DataType::Extension(typ, Box::new(storage)),
                    None => storage,
                }
            },
            #[cfg(feature = "dtype-decimal")]
            ArrowDataType::Decimal(precision, scale)
            | ArrowDataType::Decimal32(precision, scale)
            | ArrowDataType::Decimal64(precision, scale)
            | ArrowDataType::Decimal256(precision, scale) => DataType::Decimal(*precision, *scale),
            ArrowDataType::Utf8View | ArrowDataType::LargeUtf8 | ArrowDataType::Utf8 => {
                DataType::String

View on GitHub (pinned to 68506541d2)

Solutions

  1. Enable the `object` cargo feature to load POLARS_EXTENSION_TYPE fields.
  2. Rewrite the data without extension/object types if the feature cannot be enabled.
Defensive patterns

Strategy: fallback

When it happens

Trigger: This panic/expect fires when execution reaches an unguarded state described by: "activate the 'object' feature to be able to load POLARS_EXTENSION_TYPE". 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 ("activate the 'object' feature to be able to load POLARS_EXTENSION_TYPE"). 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@68506541d2 (2026-08-19). Data as JSON: /api/errors/4d1b484e02836a5c. Report an issue: GitHub.