pola-rs/polars · error

no enum variants on FileType (hint: missing feature flags?)

Error message

no enum variants on FileType (hint: missing feature flags?)

What it means

Exhausted match on FileWriteFormat in the sink-writer factory: the requested file format's writer starter is compiled out because none of the parquet/ipc/csv/json cargo features are enabled for polars-stream. It fires when creating a sink node for a format the build does not support.

Source

Thrown at crates/polars-stream/src/nodes/io_sinks/writers/mod.rs:111

            for dtype in file_schema.iter_values() {
                polars_io::json::ensure_json_writable(dtype)?;
            }

            Arc::new(
                crate::nodes::io_sinks::writers::ndjson::NDJsonWriterStarter {
                    options: *options,
                    schema: file_schema.clone(),
                    initialized_state: Default::default(),
                },
            ) as _
        },
        #[cfg(not(any(
            feature = "parquet",
            feature = "ipc",
            feature = "csv",
            feature = "json"
        )))]
        _ => panic!("no enum variants on FileType (hint: missing feature flags?)"),
    })
}

View on GitHub (pinned to 68506541d2)

Solutions

  1. Enable the matching feature flag (csv, json, parquet, ipc) for the file type you write; in Python install the full polars wheel rather than a minimal build.

Example fix

cargo build --features parquet  # enable the writer feature
Defensive patterns

Strategy: fallback

When it happens

Trigger: Writing a file type whose crate feature was not compiled in.

Common situations: See trigger scenarios.


AI-assisted analysis of pola-rs/polars@68506541d2 (2026-08-19). Data as JSON: /api/errors/0a17142bd4d54223. Report an issue: GitHub.