{"record":{"id":"b4cb07e058378cb7","repo":"pola-rs/polars","slug":"the-crate-was-compiled-without-ipc-compression-us","errorCode":null,"errorMessage":"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.","messagePattern":"The crate was compiled without IPC compression\\. Use `io_ipc_compression` to read compressed IPC\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/polars-arrow/src/io/ipc/compression.rs","lineNumber":24,"sourceCode":"#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn decompress_lz4(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {\n    use std::io::Read;\n    let mut decoder = lz4::Decoder::new(input_buf)?;\n    decoder.read_exact(output_buf).map_err(|e| e.into())\n}\n\n#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn decompress_zstd(input_buf: &[u8], output_buf: &mut [u8]) -> PolarsResult<()> {\n    use std::io::Read;\n    let mut decoder = zstd::Decoder::with_buffer(input_buf)?;\n    decoder.read_exact(output_buf).map_err(|e| e.into())\n}\n\n#[cfg(not(feature = \"io_ipc_compression\"))]\npub fn decompress_lz4(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {\n    panic!(\n        \"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.\"\n    );\n}\n\n#[cfg(not(feature = \"io_ipc_compression\"))]\npub fn decompress_zstd(_input_buf: &[u8], _output_buf: &mut [u8]) -> PolarsResult<()> {\n    panic!(\n        \"The crate was compiled without IPC compression. Use `io_ipc_compression` to read compressed IPC.\"\n    );\n}\n\n#[cfg(feature = \"io_ipc_compression\")]\n#[cfg_attr(docsrs, doc(cfg(feature = \"io_ipc_compression\")))]\npub fn compress_lz4(\n    input_buf: &[u8],\n    output_buf: &mut (impl std::io::Write + ?Sized),\n) -> PolarsResult<()> {\n    use std::io::Write;","sourceCodeStart":6,"sourceCodeEnd":42,"githubUrl":"https://github.com/pola-rs/polars/blob/9b5d73fd00236295624374b075d16b1fe6ec6df9/crates/polars-arrow/src/io/ipc/compression.rs#L6-L42","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Enable the feature: add `features = [\"io_ipc_compression\"]` to the polars-arrow dependency (for polars users: the `ipc_compression` feature) and rebuild.","If you cannot change features, re-write the file uncompressed using a tool that supports it (e.g. pyarrow).","Prefer zstd when you control both ends, but note it needs the same feature flag.","Standardize feature flags across all processes that share IPC files."],"exampleFix":"# before\n[dependencies]\npolars-arrow = \"0.4x\"\n\n# after\n[dependencies]\npolars-arrow = { version = \"0.4x\", features = [\"io_ipc_compression\"] }\n# polars users instead:\n# polars = { version = \"...\", features = [\"ipc_compression\"] }","handlingStrategy":"validation","validationCode":"// Compile-time check so misuse fails at build, not on first compressed file:\n#[cfg(not(feature = \"io_ipc_compression\"))]\ncompile_error!(\"enable `io_ipc_compression` to read LZ4/ZSTD-compressed IPC files\");","typeGuard":null,"tryCatchPattern":"let df = std::panic::catch_unwind(|| read_ipc_file(path))\n    .map_err(|_| polars_err!(ComputeError: \"file uses IPC compression but this build lacks io_ipc_compression\"))?;","preventionTips":["Enable io_ipc_compression (polars: ipc_compression) in every binary that may read shared IPC files.","Standardize compression settings across producers and consumers.","Verify effective features with `cargo tree -e features -i polars-arrow` after editing Cargo.toml."],"tags":["rust","polars","arrow","ipc","feather","lz4","compression","feature-flag","panic"],"backgroundTag":"missing-rust-feature-flag","analyzedSha":"9b5d73fd00236295624374b075d16b1fe6ec6df9","analyzedAt":"2026-08-19T12:15:06.350Z","contentChangedAt":"2026-08-19T12:15:06.350Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}