Skip to content

Enable more clippy lints (part 1/3) - #24848

Open
emilk wants to merge 3 commits into
apache:mainfrom
emilk:emilk/enable-more-clippy-lints-4
Open

Enable more clippy lints (part 1/3)#24848
emilk wants to merge 3 commits into
apache:mainfrom
emilk:emilk/enable-more-clippy-lints-4

Conversation

@emilk

@emilk emilk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Continuing the work in:

This PR was too big, so it is now part 1 of 3. The other parts are stacked on top of it:

Turn on more clippy::pedantic lints from the opt-out list in Cargo.toml.

What changes are included in this PR?

One commit per lint, each removing its "allow" line from Cargo.toml and
fixing every site. Review one commit at a time!

Let me know if you disagree with any and I'll revert it.

Lint Sites Fix
manual_string_new 84 String::new() instead of "".to_string() / "".to_owned() / "".into()
ignored_unit_patterns 52 Ok(()) instead of Ok(_), so the pattern stops matching if a payload is ever added
redundant_else 48 dropped else after a diverging branch

What is the testing strategy for this PR?

Clippy is clean both with --all-features and with default features (the latter
is what caught a cfg-gated site). The changes are mechanical, so no new tests.

Are there any user-facing changes?

No

@github-actions github-actions Bot added sql SQL Planner logical-expr Logical plan and expressions physical-expr Changes to the physical-expr crates optimizer Optimizer rules core Core DataFusion crate substrait Changes to the substrait crate catalog Related to the catalog crate common Related to common crate execution Related to the execution crate proto Related to proto crate functions Changes to functions implementation datasource Changes to the datasource crate ffi Changes to the ffi crate physical-plan Changes to the physical-plan crate spark labels Sep 1, 2026
@emilk
emilk force-pushed the emilk/enable-more-clippy-lints-4 branch from c24d083 to c866451 Compare September 1, 2026 12:46
@github-actions github-actions Bot added the auto detected api change Auto detected API change label Sep 1, 2026
@emilk
emilk force-pushed the emilk/enable-more-clippy-lints-4 branch 2 times, most recently from f32b894 to e448a28 Compare September 1, 2026 14:18
@emilk
emilk marked this pull request as ready for review September 1, 2026 14:19
@github-actions github-actions Bot added the sqllogictest SQL Logic Tests (.slt) label Sep 1, 2026
@codecov-commenter

codecov-commenter commented Sep 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 88.42444% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.74%. Comparing base (a5c809f) to head (33b2e9e).

Files with missing lines Patch % Lines
datafusion/expr/src/type_coercion/functions.rs 54.54% 5 Missing ⚠️
datafusion/sql/src/select.rs 85.71% 2 Missing and 3 partials ⚠️
datafusion/datasource-parquet/src/sink.rs 86.66% 2 Missing and 2 partials ⚠️
datafusion/execution/src/async_stream.rs 40.00% 1 Missing and 2 partials ⚠️
datafusion/spark/src/function/string/char.rs 0.00% 3 Missing ⚠️
benchmarks/src/cancellation.rs 0.00% 2 Missing ⚠️
datafusion/common/src/scalar/mod.rs 71.42% 2 Missing ⚠️
datafusion/functions-aggregate/src/first_last.rs 0.00% 2 Missing ⚠️
datafusion/common/src/error.rs 75.00% 1 Missing ⚠️
datafusion/datasource/src/memory.rs 0.00% 1 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24848      +/-   ##
==========================================
- Coverage   81.74%   81.74%   -0.01%     
==========================================
  Files        1128     1128              
  Lines      416644   416646       +2     
  Branches   416644   416646       +2     
==========================================
- Hits       340592   340589       -3     
- Misses      55995    55998       +3     
- Partials    20057    20059       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@emilk

emilk commented Sep 1, 2026

Copy link
Copy Markdown
Contributor Author

…this might be a bit big 😬 let me know if I should break it up.

(each commit in itself is pretty reviewable though)

@emilk
emilk force-pushed the emilk/enable-more-clippy-lints-4 branch from e448a28 to e686aea Compare September 7, 2026 21:16
@github-actions github-actions Bot removed the auto detected api change Auto detected API change label Sep 7, 2026
@emilk
emilk force-pushed the emilk/enable-more-clippy-lints-4 branch from 6e4144a to 770ec5d Compare September 8, 2026 12:37
`String::new()` instead of `"".to_string()` / `"".to_owned()` / `"".into()`,
which skips the copy-from-empty-slice path. All sites fixed by
`cargo clippy --fix`.
`Ok(())` instead of `Ok(_)` where the payload is `()`, so the pattern stops
matching silently if the type ever gains a payload.
Dropped `else` blocks after a branch that already diverges, removing one
level of indentation at each site.
@emilk
emilk force-pushed the emilk/enable-more-clippy-lints-4 branch from 770ec5d to 33b2e9e Compare September 8, 2026 14:29
@github-actions github-actions Bot removed sqllogictest SQL Logic Tests (.slt) ffi Changes to the ffi crate labels Sep 8, 2026
@emilk emilk changed the title Enable more clippy lints Enable more clippy lints (part 1/3) Sep 8, 2026
@emilk

emilk commented Sep 8, 2026

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

catalog Related to the catalog crate common Related to common crate core Core DataFusion crate datasource Changes to the datasource crate execution Related to the execution crate functions Changes to functions implementation logical-expr Logical plan and expressions optimizer Optimizer rules physical-expr Changes to the physical-expr crates physical-plan Changes to the physical-plan crate proto Related to proto crate spark sql SQL Planner substrait Changes to the substrait crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants