Skip to content

Commit cd12d51

Browse files
Replace deprecated structopt with clap in datafusion-benchmarks (#19492)
## Which issue does this PR close? - Closes #19482 - (Part of #19072 ) ## Rationale for this change The structopt crate is deprecated and has been superseded by clap with its derive feature. This migration: - Removes a deprecated dependency - Potentially improves compilation times for the benchmarks crate - Keeps the codebase up-to-date with modern Rust ecosystem practices ## What changes are included in this PR? - Updated Cargo.toml to use clap = { version = "4.5.53", features = ["derive"] } instead of structopt - Migrated all benchmark source files to use clap's derive macros: - `#[derive(StructOpt)]` → `#[derive(Parser/Args/Subcommand)]` - `#[structopt(...)]` → `#[arg(...)]` for fields - `#[structopt(...)]` → `#[command(...)]` for struct/enum-level attributes - `StructOpt::from_args()` → `Parser::parse()` - Removed `parse(from_os_str)` as PathBuf works natively in clap - Changed short flag strings to chars ('p' instead of "p") ## Are these changes tested? Yes ## Are there any user-facing changes? No. The CLI interface remains identical - this is a drop-in replacement of the underlying argument parsing library.
1 parent db7b8cc commit cd12d51

File tree

18 files changed

+196
-263
lines changed

18 files changed

+196
-263
lines changed

Cargo.lock

Lines changed: 25 additions & 108 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

benchmarks/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ mimalloc_extended = ["libmimalloc-sys/extended"]
4040

4141
[dependencies]
4242
arrow = { workspace = true }
43+
clap = { version = "4.5.53", features = ["derive"] }
4344
datafusion = { workspace = true, default-features = true }
4445
datafusion-common = { workspace = true, default-features = true }
4546
env_logger = { workspace = true }
@@ -54,7 +55,6 @@ regex.workspace = true
5455
serde = { version = "1.0.228", features = ["derive"] }
5556
serde_json = { workspace = true }
5657
snmalloc-rs = { version = "0.3", optional = true }
57-
structopt = { version = "0.3", default-features = false }
5858
tokio = { workspace = true, features = ["rt-multi-thread", "parking_lot"] }
5959
tokio-util = { version = "0.7.17" }
6060

0 commit comments

Comments
 (0)