Allow for .parq file ending as alternative to .parquet (#10112)

# Description

Many systems like Hadoops HDFS store parquet files with the short
variant `.parq`. It is quite annoying to rename these file before
opening them with nushell. This PR lets nushell accept .parq alongside
.parquet file endings.


# User-Facing Changes
Not sure if this is applicable here.

# Tests + Formatting

Make sure you've run and fixed any issues with these commands:

- `cargo fmt --all -- --check` to check standard code formatting (`cargo
fmt --all` applies these changes) - ✔️
- `cargo clippy --workspace -- -D warnings -D clippy::unwrap_used` to
check that you're using the standard code style - ✔️
- `cargo test --workspace` to check that all tests pass -  (fails on
none related test)
- `cargo run -- -c "use std testing; testing run-tests --path
crates/nu-std"` to run the tests for the standard library -
✔️
This commit is contained in:
Matthias Q 2023-08-24 22:57:33 +02:00 committed by GitHub
parent 1e3e034021
commit cea67cb30b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -116,7 +116,7 @@ fn command(
match type_id { match type_id {
Some((e, msg, blamed)) => match e.as_str() { Some((e, msg, blamed)) => match e.as_str() {
"csv" | "tsv" => from_csv(engine_state, stack, call), "csv" | "tsv" => from_csv(engine_state, stack, call),
"parquet" => from_parquet(engine_state, stack, call), "parquet" | "parq" => from_parquet(engine_state, stack, call),
"ipc" | "arrow" => from_ipc(engine_state, stack, call), "ipc" | "arrow" => from_ipc(engine_state, stack, call),
"json" => from_json(engine_state, stack, call), "json" => from_json(engine_state, stack, call),
"jsonl" => from_jsonl(engine_state, stack, call), "jsonl" => from_jsonl(engine_state, stack, call),