pola-rs/polars · error
activate 'binary_encoding' feature
Error message
activate 'binary_encoding' feature
What it means
Panic in StringNameSpaceImpl::hex_decode when the binary_encoding cargo feature is disabled at compile time: the implementation is compiled out. Rebuild polars-ops with binary_encoding enabled to decode hex strings.
Source
Thrown at crates/polars-ops/src/chunked_array/strings/namespace.rs:108
},
};
polars_bail!(
ComputeError:
"strict integer parsing failed for {} value(s): {}; error message for the \
first shown value: '{}' (consider non-strict parsing)",
n_failures,
some_failures.into_series().fmt_list(),
some_error_msg
);
}
Ok(out.into_series())
}
pub trait StringNameSpaceImpl: AsString {
#[cfg(not(feature = "binary_encoding"))]
fn hex_decode(&self) -> PolarsResult<StringChunked> {
panic!("activate 'binary_encoding' feature")
}
#[cfg(feature = "binary_encoding")]
fn hex_decode(&self, strict: bool) -> PolarsResult<BinaryChunked> {
let ca = self.as_string();
ca.as_binary().hex_decode(strict)
}
#[must_use]
#[cfg(feature = "string_encoding")]
fn hex_encode(&self) -> StringChunked {
let ca = self.as_string();
ca.apply_values(|s| hex::encode(s).into())
}
#[cfg(not(feature = "binary_encoding"))]
fn base64_decode(&self) -> PolarsResult<StringChunked> {
panic!("activate 'binary_encoding' feature")View on GitHub (pinned to 9b5d73fd00)
Solutions
- Enable the `binary_encoding` cargo feature for string binary encode/decode operations.
- Perform the encoding/decoding outside polars 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 'binary_encoding' feature". 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 'binary_encoding' feature"). 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@9b5d73fd00 (2026-08-19).
Data as JSON: /api/errors/452f29c8e15443b9.
Report an issue: GitHub.