pola-rs/polars · error
Unsupported in row encoding
Error message
Unsupported in row encoding
What it means
todo!() in the row-encoding dtype dispatch: the column's DataType has no row-encoding representation implemented, so it cannot participate in row-encoded operations (sort/join keys). Signals unsupported functionality for that dtype.
Source
Thrown at crates/polars-core/src/chunked_array/ops/row_encode.rs:113
| DataType::Null
| DataType::Time
| DataType::Date
| DataType::Datetime(_, _)
| DataType::Duration(_) => None,
#[cfg(feature = "dtype-categorical")]
DataType::Categorical(_, mapping) | DataType::Enum(_, mapping) => {
use polars_row::RowEncodingCategoricalContext;
Some(RowEncodingContext::Categorical(
RowEncodingCategoricalContext {
is_enum: matches!(dtype, DataType::Enum(_, _)),
mapping: mapping.clone(),
},
))
},
DataType::Unknown(_) => panic!("Unsupported in row encoding"),
#[cfg(feature = "object")]
DataType::Object(_) => panic!("Unsupported in row encoding"),
#[cfg(feature = "dtype-decimal")]
DataType::Decimal(precision, _) => Some(RowEncodingContext::Decimal(*precision)),
#[cfg(feature = "dtype-array")]
DataType::Array(dtype, _) => get_row_encoding_context(dtype),
DataType::List(dtype) => get_row_encoding_context(dtype),
#[cfg(feature = "dtype-struct")]
DataType::Struct(fs) => {
let mut ctxts = Vec::new();
for (i, f) in fs.iter().enumerate() {
if let Some(ctxt) = get_row_encoding_context(f.dtype()) {
ctxts.reserve(fs.len());
ctxts.extend(std::iter::repeat_n(None, i));View on GitHub (pinned to 68506541d2)
Solutions
- Row encoding does not support this dtype; cast the column to a supported type (numeric, string, bool) before row encoding.
- Exclude the unsupported column from the row-encoded operation.
Defensive patterns
Strategy: fallback
When it happens
Trigger: This panic/expect fires when execution reaches an unguarded state described by: "Unsupported in row encoding". 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 ("Unsupported in row encoding"). 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/624a0489062691c7.
Report an issue: GitHub.