pola-rs/polars · error
thrift bool field
Error message
thrift bool field
What it means
Internal thrift decode panic in the handwritten parquet file-metadata reader: a field that must decode as a boolean did not, violating the hand-rolled thrift expectations. Indicates malformed parquet metadata rather than user error.
Solutions
- The parquet file's thrift metadata contains an unexpected bool field encoding; the file may be corrupt.
- Re-write the parquet file with a standards-compliant writer.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: This panic/expect fires when execution reaches an unguarded state described by: "thrift bool field". 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 ("thrift bool field"). 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/93e52a44ec3286ed.
Report an issue: GitHub.
Appendix: source
Thrown at crates/polars-parquet/src/parquet/handwritten_thrift/file_metadata_thrift.rs:350
// footer; skip the bytes themselves.
read_struct_fields!(prot, |f| {
1 => prot.skip_binary()?,
2 => prot.skip_binary()?,
3 => null_count = Some(prot.read_i64()?),
4 => distinct_count = Some(prot.read_i64()?),
5 => {
let len = prot.read_vlq()? as u32;
let offset = prot.offset_from(origin_ptr);
prot.skip_bytes(len as usize)?;
max_value = Some(ByteRange { offset, len });
},
6 => {
let len = prot.read_vlq()? as u32;
let offset = prot.offset_from(origin_ptr);
prot.skip_bytes(len as usize)?;
min_value = Some(ByteRange { offset, len });
},
7 => is_max_value_exact = Some(f.bool_val.expect("thrift bool field")),
8 => is_min_value_exact = Some(f.bool_val.expect("thrift bool field")),
});
Ok(CompactStatistics {
null_count,
distinct_count,
max_value,
min_value,
is_max_value_exact,
is_min_value_exact,
})
}
/// Decode a `KeyValue` (kept as format-crate type, polars exposes it directly).
fn read_key_value(prot: &mut ThriftSliceInputProtocol<'_>) -> ParquetResult<KeyValue> {
let mut key: Option<String> = None;
let mut value: Option<String> = None;
View on GitHub (pinned to 9b5d73fd00)