pola-rs/polars · error

missing command [generate, update-hashes, check-hashes]

Error message

missing command [generate, update-hashes, check-hashes]

What it means

Panics in the dsl-schema bin driver when the command-line argument is missing: after skipping argv[0], no command (generate, update-hashes, or check-hashes) was supplied. It is an argument-presence guard for the internal CLI tool, not a runtime failure.

Source

Thrown at crates/polars-plan/src/bin/dsl-schema.rs:48

#[cfg(feature = "dsl-schema")]
mod impls {
    use std::fs::File;
    use std::io::Write;
    use std::path::Path;

    use polars_plan::dsl::DslPlan;
    use schemars::Schema;
    use sha2::Digest;

    const DEFAULT_HASHES_PATH: &str = "crates/polars-plan/dsl-schema-hashes.json";

    pub fn run() {
        let mut args = std::env::args();

        let _ = args.next();
        let cmd = args
            .next()
            .expect("missing command [generate, update-hashes, check-hashes]");
        let path = args.next();

        if let Some(unknown) = args.next() {
            panic!("unknown argument: `{unknown}`");
        }

        match cmd.as_str() {
            "generate" => {
                generate(path.unwrap_or("./dsl-schema.json".to_owned()));
            },
            "update-hashes" => {
                update_hashes(path.unwrap_or(DEFAULT_HASHES_PATH.to_owned()));
            },
            "check-hashes" => {
                check_hashes(path.unwrap_or(DEFAULT_HASHES_PATH.to_owned()));
            },
            unknown => {
                panic!("unknown command: `{unknown}`");

View on GitHub (pinned to 9b5d73fd00)

Solutions

  1. Pass one of the supported subcommands: generate, update-hashes, or check-hashes.
  2. Run the tool with `--help` to see the required arguments.
Defensive patterns

Strategy: validation

When it happens

Trigger: This panic/expect fires when execution reaches an unguarded state described by: "missing command [generate, update-hashes, check-hashes]". 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 ("missing command [generate, update-hashes, check-hashes]"). 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/446486e8849b7504. Report an issue: GitHub.