Skip to content

Commit 5519b61

Browse files
authored
deny on allow_attributes lint in physical-plan (#18983)
## Which issue does this PR close? - Part of #18881. ## What changes are included in this PR? Deny attribute for allow_attrbute lint on physical-plan, this allows it to not be applied on imported crates, also, a few of the functions no longer required their respective lints, such as too_many_arguments, hence, I had them removed. ## Are these changes tested? I've ran the entire clippy suite before creating a PR. ## Are there any user-facing changes? There weren't any user-facing changes
1 parent bc47cbe commit 5519b61

File tree

26 files changed

+34
-58
lines changed

26 files changed

+34
-58
lines changed

datafusion/physical-expr/src/aggregate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
// under the License.
1717

1818
pub(crate) mod groups_accumulator {
19-
#[allow(unused_imports)]
19+
#[expect(unused_imports)]
2020
pub(crate) mod accumulate {
2121
pub use datafusion_functions_aggregate_common::aggregate::groups_accumulator::accumulate::NullState;
2222
}

datafusion/physical-expr/src/intervals/cp_solver.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -780,7 +780,7 @@ mod tests {
780780
use rand::{Rng, SeedableRng};
781781
use rstest::*;
782782

783-
#[allow(clippy::too_many_arguments)]
783+
#[expect(clippy::too_many_arguments)]
784784
fn experiment(
785785
expr: Arc<dyn PhysicalExpr>,
786786
exprs_with_interval: (Arc<dyn PhysicalExpr>, Arc<dyn PhysicalExpr>),

datafusion/physical-expr/src/intervals/test_utils.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ use arrow::datatypes::Schema;
2525
use datafusion_common::{DataFusionError, ScalarValue};
2626
use datafusion_expr::Operator;
2727

28-
#[allow(clippy::too_many_arguments)]
28+
#[expect(clippy::too_many_arguments)]
2929
/// This test function generates a conjunctive statement with two numeric
3030
/// terms with the following form:
3131
/// left_col (op_1) a >/>= right_col (op_2) b AND left_col (op_3) c </<= right_col (op_4) d
@@ -61,7 +61,7 @@ pub fn gen_conjunctive_numerical_expr(
6161
Arc::new(BinaryExpr::new(left_expr, Operator::And, right_expr))
6262
}
6363

64-
#[allow(clippy::too_many_arguments)]
64+
#[expect(clippy::too_many_arguments)]
6565
/// This test function generates a conjunctive statement with
6666
/// two scalar values with the following form:
6767
/// left_col (op_1) a > right_col (op_2) b AND left_col (op_3) c < right_col (op_4) d

datafusion/physical-expr/src/lib.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
// https://github.com/apache/datafusion/issues/11143
2525
#![deny(clippy::clone_on_ref_ptr)]
2626
#![cfg_attr(test, allow(clippy::needless_pass_by_value))]
27+
// https://github.com/apache/datafusion/issues/18881
28+
#![deny(clippy::allow_attributes)]
2729

2830
// Backward compatibility
2931
pub mod aggregate;

datafusion/physical-expr/src/window/standard_window_function_expr.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,13 @@ use std::any::Any;
2828
use std::sync::Arc;
2929

3030
/// Evaluates a window function by instantiating a
31-
/// `[PartitionEvaluator]` for calculating the function's output in
31+
/// [`PartitionEvaluator`] for calculating the function's output in
3232
/// that partition.
3333
///
3434
/// Note that unlike aggregation based window functions, some window
3535
/// functions such as `rank` ignore the values in the window frame,
3636
/// but others such as `first_value`, `last_value`, and
3737
/// `nth_value` need the value.
38-
#[allow(rustdoc::private_intra_doc_links)]
3938
pub trait StandardWindowFunctionExpr: Send + Sync + std::fmt::Debug {
4039
/// Returns the aggregate expression as [`Any`] so that it can be
4140
/// downcast to a specific implementation.

datafusion/physical-expr/src/window/window_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ pub trait AggregateWindowExpr: WindowExpr {
281281
/// * `window_frame_ctx`: Details about the window frame (see [`WindowFrameContext`]).
282282
/// * `idx`: The index of the current row in the record batch.
283283
/// * `not_end`: is the current row not the end of the partition (see [`PartitionBatchState`]).
284-
#[allow(clippy::too_many_arguments)]
284+
#[expect(clippy::too_many_arguments)]
285285
fn get_result_column(
286286
&self,
287287
accumulator: &mut Box<dyn Accumulator>,

datafusion/physical-plan/src/aggregates/mod.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -377,7 +377,7 @@ impl PartialEq for PhysicalGroupBy {
377377
}
378378
}
379379

380-
#[allow(clippy::large_enum_variant)]
380+
#[expect(clippy::large_enum_variant)]
381381
enum StreamType {
382382
AggregateStream(AggregateStream),
383383
GroupedHash(GroupedHashAggregateStream),
@@ -575,7 +575,6 @@ impl AggregateExec {
575575
/// a rule may re-write aggregate expressions (e.g. reverse them) during
576576
/// initialization, field names may change inadvertently if one re-creates
577577
/// the schema in such cases.
578-
#[allow(clippy::too_many_arguments)]
579578
fn try_new_with_schema(
580579
mode: AggregateMode,
581580
group_by: PhysicalGroupBy,

datafusion/physical-plan/src/execution_plan.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@ mod tests {
15341534
/// A compilation test to ensure that the `ExecutionPlan::name()` method can
15351535
/// be called from a trait object.
15361536
/// Related ticket: https://github.com/apache/datafusion/pull/11047
1537-
#[allow(dead_code)]
1537+
#[expect(unused)]
15381538
fn use_execution_plan_as_trait_object(plan: &dyn ExecutionPlan) {
15391539
let _ = plan.name();
15401540
}

datafusion/physical-plan/src/joins/cross_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ struct JoinLeftData {
6161
_reservation: MemoryReservation,
6262
}
6363

64-
#[allow(rustdoc::private_intra_doc_links)]
64+
#[expect(rustdoc::private_intra_doc_links)]
6565
/// Cross Join Execution Plan
6666
///
6767
/// This operator is used when there are no predicates between two tables and

datafusion/physical-plan/src/joins/hash_join/exec.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl JoinLeftData {
142142
}
143143
}
144144

145-
#[allow(rustdoc::private_intra_doc_links)]
145+
#[expect(rustdoc::private_intra_doc_links)]
146146
/// Join execution plan: Evaluates equijoin predicates in parallel on multiple
147147
/// partitions using a hash table and an optional filter list to apply post
148148
/// join.
@@ -387,7 +387,7 @@ impl HashJoinExec {
387387
///
388388
/// # Error
389389
/// This function errors when it is not possible to join the left and right sides on keys `on`.
390-
#[allow(clippy::too_many_arguments)]
390+
#[expect(clippy::too_many_arguments)]
391391
pub fn try_new(
392392
left: Arc<dyn ExecutionPlan>,
393393
right: Arc<dyn ExecutionPlan>,
@@ -1336,7 +1336,7 @@ impl BuildSideState {
13361336
/// # Returns
13371337
/// `JoinLeftData` containing the hash map, consolidated batch, join key values,
13381338
/// visited indices bitmap, and computed bounds (if requested).
1339-
#[allow(clippy::too_many_arguments)]
1339+
#[expect(clippy::too_many_arguments)]
13401340
async fn collect_left_input(
13411341
random_state: RandomState,
13421342
left_stream: SendableRecordBatchStream,

0 commit comments

Comments
 (0)