Skip to content

Commit c92d781

Browse files
authored
fix: restore all-features Clippy for DataFrame aggregate rewrites (apache#26590)
## Which issue does this PR close? Closes apache#26181. ## Rationale for this change On `main` at `2717e25625ff0c51c1805f8df52d317979db74ec`, `cargo clippy --all-targets --all-features -- -D warnings` fails with two `clippy::mutable_key_type` errors in `alias_aggregate_exprs` and `rewrite_select_aggs`. The diagnostics follow `Expr` through nested `ScalarValue` arrays to Arrow's `TrackedReservation`. That mutable memory accounting does not affect expression equality or hashing. The earlier `PushDownFilter` occurrences discussed in apache#26189 are already fixed on `main`. ## What changes are included in this PR? Add explained lint allowances on the aggregate rewrite map declaration and `rewrite_select_aggs`, following existing `Expr` key handling. No runtime code changes. ## What is the testing strategy for this PR? - Reproduced both errors on unmodified `main`; the exact command passes with this change. - `cargo fmt --all` and `git diff --check` pass. - `uv run ./dev/rust_lint.sh` passes, including CI Clippy, dependency checks, and documentation builds. - All 240 existing DataFrame integration tests pass, including `test_dataframe_api_select_semantics`, aggregate aliases, and name collisions. - Extended workspace validation passes: 12,819 Rust tests passed, 8 ignored, and 538 SQL logic test files completed: ```sh RUST_BACKTRACE=1 cargo test --profile ci \ --exclude datafusion-examples --exclude datafusion-benchmarks --exclude datafusion-cli \ --workspace --lib --tests --bins \ --features avro,json,backtrace,extended_tests,recursive_protection,parquet_encryption ``` No new runtime tests or benchmarks: this change adds only lint attributes and explanatory comments. ## Are there any user-facing changes? The documented all-features Clippy command passes again. No SQL behavior or public API changes.
1 parent 0ab1fd2 commit c92d781

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

  • datafusion/core/src/dataframe

‎datafusion/core/src/dataframe/mod.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,8 @@ fn alias_aggregate_exprs(
298298
) -> Result<(Vec<Expr>, HashMap<Expr, Expr>)> {
299299
let exprs = normalize_cols(exprs, plan)?;
300300
let mut used = HashSet::new();
301+
// Arrow buffer memory accounting does not affect expression equality or hashing.
302+
#[allow(clippy::allow_attributes, clippy::mutable_key_type)]
301303
let mut rewrite_map = HashMap::new();
302304
let mut aliased = Vec::with_capacity(exprs.len());
303305
for expr in exprs {
@@ -318,6 +320,8 @@ fn alias_aggregate_exprs(
318320
}
319321

320322
/// Replace aggregate subexpressions with columns produced by the Aggregate node.
323+
// Arrow buffer memory accounting does not affect expression equality or hashing.
324+
#[allow(clippy::allow_attributes, clippy::mutable_key_type)]
321325
fn rewrite_select_aggs(
322326
expr_list: Vec<SelectExpr>,
323327
input: &LogicalPlan,

0 commit comments

Comments
 (0)