pola-rs/polars · error
unknown command
Error message
unknown command: `{unknown}` What it means
After validating argument count, the binary matches the subcommand against "generate", "update-hashes", and "check-hashes". Any other first argument falls into the catch-all arm and panics with this message. It is a typo/unsupported-command guard.
Solutions
- Use one of the exact command names: `generate`, `update-hashes`, or `check-hashes`.
- Fix typos (`gen` -> `generate`, `check` -> `check-hashes`).
- Inspect crates/polars-plan/src/bin/dsl-schema.rs to see the current command list.
Example fix
// before dsl-schema check hashes.json // after dsl-schema check-hashes hashes.json
Defensive patterns
Strategy: validation
Validate before calling
const VALID = new Set(["generate", "update-hashes", "check-hashes"]);
if (!VALID.has(cmd)) throw new Error(`unknown command: ${cmd}`); Prevention
- Use the exact command names; no abbreviations are accepted.
- Keep a canonical invocation snippet in team docs/Makefile.
- Check dsl-schema.rs source when unsure of the command list.
When it happens
Trigger: Running the binary with a first argument that is not one of the three supported commands, e.g. `dsl-schema gen`, `dsl-schema check`, `dsl-schema help`.
Common situations: Typos or abbreviations of subcommands, guessing command names, or scripts written against an older/newer CLI surface with different command names.
Understand the failure class
Background: "Unknown argument", "Invalid value", and "must be one of": invalid CLI argument errors explained — this error's family across 35 libraries.
Related errors
- missing command [generate, update-hashes, check-hashes]
- unknown argument
- activate 'decompress' feature
- activate dtype
- activate feature dynamic_group_by
AI-assisted analysis of pola-rs/polars@fe841f959e (2026-09-18).
Data as JSON: /api/errors/1019ded6c65a09d8.
Report an issue: GitHub.
Appendix: source
Thrown at crates/polars-plan/src/bin/dsl-schema.rs:66
.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}`");
},
}
}
/// Serializes the current DSL schema into a file at the given path.
///
/// Any existing file at the path is overwritten.
fn generate(path: impl AsRef<Path>) {
let schema = DslPlan::dsl_schema();
let mut file = File::create(path).expect("failed to open the schema file for writing");
serde_json::to_writer_pretty(&mut file, &schema).expect("failed to serialize the schema");
writeln!(&mut file).expect("failed to write the last newline");
file.flush().expect("failed to flush the schema file");
}
/// Outputs the current DSL schema hashes into a file at the given path.
///View on GitHub (pinned to fe841f959e)