pola-rs/polars · error

The crate was compiled without IPC compression. Use `io_ipc_

Error message

The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.

What it means

When polars-arrow is compiled without the `io_ipc_compression` feature, `decompress_lz4` (crates/polars-arrow/src/io/ipc/compression.rs) is a stub that unconditionally panics with 'The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.' The function still exists so the code compiles, but any attempt to actually decode an LZ4-compressed IPC buffer aborts.

Source

Thrown at crates/polars-arrow/src/io/ipc/compression.rs:24

#[cfg(feature = "io_ipc_compression")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc_compression")))]
pub fn decompress_lz4(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {
    use std::io::Read;
    let mut decoder = lz4::Decoder::new(input_buf)?;
    decoder.read_exact(output_buf).map_err(|e| e.into())
}

#[cfg(feature = "io_ipc_compression")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc_compression")))]
pub fn decompress_zstd(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {
    use std::io::Read;
    let mut decoder = zstd::Decoder::with_buffer(input_buf)?;
    decoder.read_exact(output_buf).map_err(|e| e.into())
}

#[cfg(not(feature = "io_ipc_compression"))]
pub fn decompress_lz4(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {
    panic!(
        "The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC."
    );
}

#[cfg(not(feature = "io_ipc_compression"))]
pub fn decompress_zstd(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {
    panic!(
        "The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC."
    );
}

#[cfg(feature = "io_ipc_compression")]
#[cfg_attr(docsrs, doc(cfg(feature = "io_ipc_compression")))]
pub fn compress_lz4(
    input_buf: &[u8],
    output_buf: &mut (impl std::io::Write + ?Sized),
) -> PolarsResult<()> {
    use std::io::Write;

View on GitHub (pinned to 9b5d73fd00)

Solutions

  1. Enable the feature: add `features = ["io_ipc_compression"]` to the polars-arrow dependency (for polars users: the `ipc_compression` feature) and rebuild.
  2. If you cannot change features, re-write the file uncompressed using a tool that supports it (e.g. pyarrow).
  3. Prefer zstd when you control both ends, but note it needs the same feature flag.
  4. Standardize feature flags across all processes that share IPC files.

Example fix

# before
[dependencies]
polars-arrow = "0.4x"

# after
[dependencies]
polars-arrow = { version = "0.4x", features = ["io_ipc_compression"] }
# polars users instead:
# polars = { version = "...", features = ["ipc_compression"] }
Defensive patterns

Strategy: validation

Validate before calling

// Compile-time check so misuse fails at build, not on first compressed file:
#[cfg(not(feature = "io_ipc_compression"))]
compile_error!("enable `io_ipc_compression` to read LZ4/ZSTD-compressed IPC files");

Try / catch

let df = std::panic::catch_unwind(|| read_ipc_file(path))
    .map_err(|_| polars_err!(ComputeError: "file uses IPC compression but this build lacks io_ipc_compression"))?;

Prevention

When it happens

Trigger: Reading an Arrow IPC/Feather V2 file or stream whose batches were written with LZ4 compression while the crate lacks the feature — the IPC reader dispatches on the batch's compression flag straight into decompress_lz4. In polars terms this is gated behind the `ipc_compression` feature.

Common situations: Default-feature builds of polars/polars-arrow (compression is off by default) reading files written with compression enabled elsewhere (e.g. pyarrow feather.write_ipc(compression='lz4'), or a polars build with the feature on). CI/dev machines with different feature flags than the data producer.

Related errors


AI-assisted analysis of pola-rs/polars@9b5d73fd00 (2026-08-19). Data as JSON: /api/errors/b4cb07e058378cb7. Report an issue: GitHub.