This is an automated email from the ASF dual-hosted git repository.

github-bot pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/datafusion.git


The following commit(s) were added to refs/heads/main by this push:
     new 41f7137585 chore: enforce clippy::allow_attributes for physical crates 
(#19185)
41f7137585 is described below

commit 41f7137585d0b2538aae89c80bb1dc6459bdeb1d
Author: Carlos Hurtado <[email protected]>
AuthorDate: Sun Dec 7 18:11:21 2025 -0600

    chore: enforce clippy::allow_attributes for physical crates (#19185)
    
    ## Which issue does this PR close?
    
    <!--
    We generally require a GitHub issue to be filed for all bug fixes and
    enhancements and this helps us generate change logs for our releases.
    You can link an issue to this PR using the GitHub syntax. For example
    `Closes #123` indicates that this PR will close issue #123.
    -->
    
    - Part of #18881.
    
    ## Rationale for this change
    
    <!--
    Why are you proposing this change? If this is already explained clearly
    in the issue then this section is not needed.
    Explaining clearly why changes are proposed helps reviewers understand
    your changes and offer better suggestions for fixes.
    -->
    
    Please refer to https://github.com/apache/datafusion/issues/18881.
    
    ## What changes are included in this PR?
    
    <!--
    There is no need to duplicate the description in the issue here but it
    is sometimes worth providing a summary of the individual changes in this
    PR.
    -->
    
    + Added `#![deny(clippy::allow_attributes)]` to the following crates:
      + `datafusion-physical-expr-adapter`.
      + `datafusion-physical-expr-common`.
      + `datafusion-physical-optimizer`.
    + Removed `#[allow(deprecated)]` from
    
https://github.com/apache/datafusion/blob/cb2f3d2a86f15aa857b8a297277d9c79a36bd6e8/datafusion/physical-optimizer/src/filter_pushdown.rs#L432-L443
    as [lint is only fulfilled on usage of `#[deprecated]`
    
items](https://doc.rust-lang.org/reference/attributes/diagnostics.html#r-attributes.diagnostics.deprecated.intro),
    thus when `#[expect(deprecated)]` is used instead of
    `#[allow(deprecated)]` it results in `error: this lint expectation is
    unfulfilled`.
    + Kept `#[allow(clippy::only_used_in_recursion)]` in
    
https://github.com/apache/datafusion/blob/6746007826ebd3fcb5614bf87183674435bbb134/datafusion/physical-optimizer/src/aggregate_statistics.rs#L43-L98
    as `#[expect(clippy::only_used_in_recursion)]` resulted in `error: this
    lint expectation is unfulfilled` when running `sh
    ci/scripts/rust_clippy.sh` but was successful when running `cargo clippy
    -p datafusion-physical-optimizer -- -D warning`. Ref:
    https://github.com/apache/datafusion/issues/18881#issuecomment-3620944778.
    
    For now, easiest solution is to locally expect
    `#[expect(clippy::allow_attributes)]`.
    
    ## Are these changes tested?
    
    <!--
    We typically require tests for all PRs in order to:
    1. Prevent the code from being accidentally broken by subsequent changes
    2. Serve as another way to document the expected behavior of the code
    
    If tests are not included in your PR, please explain why (for example,
    are they covered by existing tests)?
    -->
    
    Successfully ran `sh ci/scripts/rust_clippy.sh`.
    
    ## Are there any user-facing changes?
    
    <!--
    If there are user-facing changes then we may require documentation to be
    updated before approving the PR.
    -->
    
    <!--
    If there are any breaking changes to public APIs, please add the `api
    change` label.
    -->
    
    No.
---
 datafusion/physical-expr-adapter/src/lib.rs                    | 2 ++
 datafusion/physical-expr-common/src/lib.rs                     | 2 ++
 datafusion/physical-optimizer/src/aggregate_statistics.rs      | 3 ++-
 datafusion/physical-optimizer/src/coalesce_batches.rs          | 2 +-
 datafusion/physical-optimizer/src/combine_partial_final_agg.rs | 2 +-
 datafusion/physical-optimizer/src/enforce_distribution.rs      | 2 +-
 datafusion/physical-optimizer/src/enforce_sorting/mod.rs       | 2 +-
 datafusion/physical-optimizer/src/filter_pushdown.rs           | 1 -
 datafusion/physical-optimizer/src/join_selection.rs            | 2 +-
 datafusion/physical-optimizer/src/lib.rs                       | 2 ++
 datafusion/physical-optimizer/src/limit_pushdown.rs            | 2 +-
 datafusion/physical-optimizer/src/optimizer.rs                 | 2 +-
 datafusion/physical-optimizer/src/projection_pushdown.rs       | 2 +-
 datafusion/physical-optimizer/src/sanity_checker.rs            | 2 +-
 datafusion/physical-optimizer/src/update_aggr_exprs.rs         | 2 +-
 15 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/datafusion/physical-expr-adapter/src/lib.rs 
b/datafusion/physical-expr-adapter/src/lib.rs
index ce9b15e3b1..9586372803 100644
--- a/datafusion/physical-expr-adapter/src/lib.rs
+++ b/datafusion/physical-expr-adapter/src/lib.rs
@@ -21,6 +21,8 @@
     html_favicon_url = 
"https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg";
 )]
 #![cfg_attr(docsrs, feature(doc_cfg))]
+// https://github.com/apache/datafusion/issues/18881
+#![deny(clippy::allow_attributes)]
 
 //! Physical expression schema adaptation utilities for DataFusion
 
diff --git a/datafusion/physical-expr-common/src/lib.rs 
b/datafusion/physical-expr-common/src/lib.rs
index 76eaed40a7..7665e45613 100644
--- a/datafusion/physical-expr-common/src/lib.rs
+++ b/datafusion/physical-expr-common/src/lib.rs
@@ -24,6 +24,8 @@
 // https://github.com/apache/datafusion/issues/11143
 #![deny(clippy::clone_on_ref_ptr)]
 #![cfg_attr(test, allow(clippy::needless_pass_by_value))]
+// https://github.com/apache/datafusion/issues/18881
+#![deny(clippy::allow_attributes)]
 
 //! Physical Expr Common packages for [DataFusion]
 //! This package contains high level PhysicalExpr trait
diff --git a/datafusion/physical-optimizer/src/aggregate_statistics.rs 
b/datafusion/physical-optimizer/src/aggregate_statistics.rs
index eee333926b..19cc0b5070 100644
--- a/datafusion/physical-optimizer/src/aggregate_statistics.rs
+++ b/datafusion/physical-optimizer/src/aggregate_statistics.rs
@@ -33,7 +33,7 @@ use crate::{OptimizerContext, PhysicalOptimizerRule};
 pub struct AggregateStatistics {}
 
 impl AggregateStatistics {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
@@ -41,6 +41,7 @@ impl AggregateStatistics {
 
 impl PhysicalOptimizerRule for AggregateStatistics {
     #[cfg_attr(feature = "recursive_protection", recursive::recursive)]
+    #[expect(clippy::allow_attributes)] // See 
https://github.com/apache/datafusion/issues/18881#issuecomment-3621545670
     #[allow(clippy::only_used_in_recursion)] // See 
https://github.com/rust-lang/rust-clippy/issues/14566
     fn optimize_plan(
         &self,
diff --git a/datafusion/physical-optimizer/src/coalesce_batches.rs 
b/datafusion/physical-optimizer/src/coalesce_batches.rs
index 1ad8146edf..e3f2df93fb 100644
--- a/datafusion/physical-optimizer/src/coalesce_batches.rs
+++ b/datafusion/physical-optimizer/src/coalesce_batches.rs
@@ -38,7 +38,7 @@ use datafusion_common::tree_node::{Transformed, 
TransformedResult, TreeNode};
 pub struct CoalesceBatches {}
 
 impl CoalesceBatches {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self::default()
     }
diff --git a/datafusion/physical-optimizer/src/combine_partial_final_agg.rs 
b/datafusion/physical-optimizer/src/combine_partial_final_agg.rs
index f189a7f3f0..5aea611f4c 100644
--- a/datafusion/physical-optimizer/src/combine_partial_final_agg.rs
+++ b/datafusion/physical-optimizer/src/combine_partial_final_agg.rs
@@ -39,7 +39,7 @@ use datafusion_physical_expr::{physical_exprs_equal, 
PhysicalExpr};
 pub struct CombinePartialFinalAggregate {}
 
 impl CombinePartialFinalAggregate {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/enforce_distribution.rs 
b/datafusion/physical-optimizer/src/enforce_distribution.rs
index 78e5c4edb2..571c07ff80 100644
--- a/datafusion/physical-optimizer/src/enforce_distribution.rs
+++ b/datafusion/physical-optimizer/src/enforce_distribution.rs
@@ -184,7 +184,7 @@ use itertools::izip;
 pub struct EnforceDistribution {}
 
 impl EnforceDistribution {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/enforce_sorting/mod.rs 
b/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
index 69593697e2..69090f8ef6 100644
--- a/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
+++ b/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
@@ -79,7 +79,7 @@ use itertools::izip;
 pub struct EnforceSorting {}
 
 impl EnforceSorting {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/filter_pushdown.rs 
b/datafusion/physical-optimizer/src/filter_pushdown.rs
index 671c16c897..eacffa9198 100644
--- a/datafusion/physical-optimizer/src/filter_pushdown.rs
+++ b/datafusion/physical-optimizer/src/filter_pushdown.rs
@@ -429,7 +429,6 @@ impl PhysicalOptimizerRule for FilterPushdown {
         )
     }
 
-    #[allow(deprecated)]
     fn optimize(
         &self,
         plan: Arc<dyn ExecutionPlan>,
diff --git a/datafusion/physical-optimizer/src/join_selection.rs 
b/datafusion/physical-optimizer/src/join_selection.rs
index b6ff8344a3..8f337bc8d9 100644
--- a/datafusion/physical-optimizer/src/join_selection.rs
+++ b/datafusion/physical-optimizer/src/join_selection.rs
@@ -47,7 +47,7 @@ use std::sync::Arc;
 pub struct JoinSelection {}
 
 impl JoinSelection {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/lib.rs 
b/datafusion/physical-optimizer/src/lib.rs
index 07f61d3d04..d1bf375bd0 100644
--- a/datafusion/physical-optimizer/src/lib.rs
+++ b/datafusion/physical-optimizer/src/lib.rs
@@ -24,6 +24,8 @@
 // https://github.com/apache/datafusion/issues/11143
 #![deny(clippy::clone_on_ref_ptr)]
 #![cfg_attr(test, allow(clippy::needless_pass_by_value))]
+// https://github.com/apache/datafusion/issues/18881
+#![deny(clippy::allow_attributes)]
 
 pub mod aggregate_statistics;
 pub mod coalesce_batches;
diff --git a/datafusion/physical-optimizer/src/limit_pushdown.rs 
b/datafusion/physical-optimizer/src/limit_pushdown.rs
index d70e8da9dd..74f1af2ff5 100644
--- a/datafusion/physical-optimizer/src/limit_pushdown.rs
+++ b/datafusion/physical-optimizer/src/limit_pushdown.rs
@@ -52,7 +52,7 @@ pub struct GlobalRequirements {
 }
 
 impl LimitPushdown {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/optimizer.rs 
b/datafusion/physical-optimizer/src/optimizer.rs
index 0f3467bfbb..4524947135 100644
--- a/datafusion/physical-optimizer/src/optimizer.rs
+++ b/datafusion/physical-optimizer/src/optimizer.rs
@@ -95,7 +95,7 @@ pub trait PhysicalOptimizerRule: Debug {
         context: &OptimizerContext,
     ) -> Result<Arc<dyn ExecutionPlan>> {
         // Default implementation: delegate to the old method for backwards 
compatibility
-        #[allow(deprecated)]
+        #[expect(deprecated)]
         self.optimize(plan, context.session_config().options())
     }
 
diff --git a/datafusion/physical-optimizer/src/projection_pushdown.rs 
b/datafusion/physical-optimizer/src/projection_pushdown.rs
index fa562825c6..89a595f61b 100644
--- a/datafusion/physical-optimizer/src/projection_pushdown.rs
+++ b/datafusion/physical-optimizer/src/projection_pushdown.rs
@@ -49,7 +49,7 @@ use datafusion_physical_plan::ExecutionPlan;
 pub struct ProjectionPushdown {}
 
 impl ProjectionPushdown {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/sanity_checker.rs 
b/datafusion/physical-optimizer/src/sanity_checker.rs
index fc9187ba54..7e81ba5f15 100644
--- a/datafusion/physical-optimizer/src/sanity_checker.rs
+++ b/datafusion/physical-optimizer/src/sanity_checker.rs
@@ -47,7 +47,7 @@ use itertools::izip;
 pub struct SanityCheckPlan {}
 
 impl SanityCheckPlan {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self {}
     }
diff --git a/datafusion/physical-optimizer/src/update_aggr_exprs.rs 
b/datafusion/physical-optimizer/src/update_aggr_exprs.rs
index 39852a2293..604bc6c3e1 100644
--- a/datafusion/physical-optimizer/src/update_aggr_exprs.rs
+++ b/datafusion/physical-optimizer/src/update_aggr_exprs.rs
@@ -48,7 +48,7 @@ use crate::{OptimizerContext, PhysicalOptimizerRule};
 pub struct OptimizeAggregateOrder {}
 
 impl OptimizeAggregateOrder {
-    #[allow(missing_docs)]
+    #[expect(missing_docs)]
     pub fn new() -> Self {
         Self::default()
     }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to