[AURON #1912] Clean up rust default lints#2039
Conversation
There was a problem hiding this comment.
Pull request overview
This pull request removes workspace-level lint allowances for unused_variables, dead_code, unused_imports, unused_must_use, and deprecated from Cargo.toml, and addresses these lint warnings throughout the codebase by either fixing the issues or adding targeted #[allow(...)] attributes where necessary.
Changes:
- Removed workspace-level lint allowances from Cargo.toml
- Migrated from deprecated
statistics()topartition_statistics(None)API across multiple execution plan implementations - Removed unused imports across several modules
- Added targeted
#[allow(deprecated)]and#[allow(dead_code)]attributes where deprecated APIs must still be used or code should be preserved
Reviewed changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| Cargo.toml | Removed workspace-level lint allowances for unused_variables, dead_code, unused_imports, unused_must_use, and deprecated |
| native-engine/datafusion-ext-plans/src/sort_exec.rs | Migrated to partition_statistics API, silenced skip_rows results, added deprecated allowance for fuzztest module |
| native-engine/datafusion-ext-plans/src/shuffle_writer_exec.rs | Migrated to partition_statistics API |
| native-engine/datafusion-ext-plans/src/rss_shuffle_writer_exec.rs | Migrated to partition_statistics API |
| native-engine/datafusion-ext-plans/src/parquet_sink_exec.rs | Added deprecated allowance for set_max_statistics_size usage |
| native-engine/datafusion-ext-plans/src/parquet_exec.rs | Added deprecated allowance for fetch_parquet_metadata and dead_code allowance for expr_contains_decimal_type |
| native-engine/datafusion-ext-plans/src/limit_exec.rs | Migrated to partition_statistics API, added deprecated allowance for test module |
| native-engine/datafusion-ext-plans/src/agg/spark_udaf_wrapper.rs | Removed unused imports (Cursor, Read, Write, ArrayAccessor, BinaryArray, BinaryBuilder, UninitializedInit) |
| native-engine/datafusion-ext-functions/src/lib.rs | Added unused_variables allowance for spark_partition_id parameter |
| native-engine/datafusion-ext-exprs/src/spark_scalar_subquery_wrapper.rs | Removed unused Write import |
| native-engine/datafusion-ext-exprs/src/lib.rs | Added dead_code allowance for down_cast_any_ref function |
| native-engine/datafusion-ext-exprs/src/get_indexed_field.rs | Removed unused Hasher import |
| native-engine/datafusion-ext-commons/src/arrow/eq_comparator.rs | Modified test_bytes to handle Result returns from test_bytes_impl |
| native-engine/auron-planner/src/planner.rs | Removed unused imports (ExprSchema, PhysicalExpr) |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let _ = test_bytes_impl::<Utf8Type>(); | ||
| let _ = test_bytes_impl::<LargeUtf8Type>(); | ||
| let _ = test_bytes_impl::<BinaryType>(); | ||
| let _ = test_bytes_impl::<LargeBinaryType>(); |
There was a problem hiding this comment.
The test is silencing potential errors from test_bytes_impl by using let _ = instead of propagating them with the ? operator. If test_bytes_impl fails, the test will still pass instead of failing. Each call should use the ? operator to propagate errors, for example: test_bytes_impl::<Utf8Type>()?;
Which issue does this PR close?
Closes #1912
Rationale for this change
What changes are included in this PR?
Are there any user-facing changes?
How was this patch tested?