Apache DataFusion SQL Query Engine
chore: enforce clippy::allow_attributes for 7 crates (#19133)
chakkk309e91493566087
diff --git a/datafusion/catalog-listing/src/mod.rs b/datafusion/catalog-listing/src/mod.rsindex bb4ff7bd02..dfb193317b 100644--- a/datafusion/catalog-listing/src/mod.rs+++ b/datafusion/catalog-listing/src/mod.rs@@ -15,6 +15,7 @@// specific language governing permissions and limitations// under the License.+#![deny(clippy::allow_attributes)]#![cfg_attr(test, allow(clippy::needless_pass_by_value))]#![doc(html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",diff --git a/datafusion/core/src/lib.rs b/datafusion/core/src/lib.rsindex da8ffe298b..e83934a8e2 100644--- a/datafusion/core/src/lib.rs+++ b/datafusion/core/src/lib.rs@@ -15,6 +15,7 @@// specific language governing permissions and limitations// under the License.+#![deny(clippy::allow_attributes)]#![doc(html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"@@ -35,6 +36,8 @@))]#![warn(missing_docs, clippy::needless_borrow)]+// Use `allow` instead of `expect` for test configuration to explicitly+// disable the lint for all test code rather than expecting violations#![cfg_attr(test, allow(clippy::needless_pass_by_value))]//! [DataFusion] is an extensible query engine written in Rust thatdiff --git a/datafusion/doc/src/lib.rs b/datafusion/doc/src/lib.rsindex 591a5a62f3..836cb9345b 100644--- a/datafusion/doc/src/lib.rs+++ b/datafusion/doc/src/lib.rs@@ -15,6 +15,7 @@// specific language governing permissions and limitations// under the License.+#![deny(clippy::allow_attributes)]#![cfg_attr(test, allow(clippy::needless_pass_by_value))]#![doc(html_logo_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg",diff --git a/datafusion/execution/src/disk_manager.rs b/datafusion/execution/src/disk_manager.rsindex 1272e6c5f8..cb87053d8d 100644--- a/datafusion/execution/src/disk_manager.rs+++ b/datafusion/execution/src/disk_manager.rs@@ -115,9 +115,10 @@ pub enum DiskManagerMode {}/// Configuration for temporary disk access-#[allow(deprecated)]#[deprecated(since = "48.0.0", note = "Use DiskManagerBuilder instead")]#[derive(Debug, Clone, Default)]+#[allow(clippy::allow_attributes)]+#[allow(deprecated)]pub enum DiskManagerConfig {/// Use the provided [DiskManager] instanceExisting(Arc<DiskManager>),@@ -135,7 +136,7 @@ pub enum DiskManagerConfig {Disabled,}-#[allow(deprecated)]+#[expect(deprecated)]impl DiskManagerConfig {/// Create temporary files in a temporary directory chosen by the OSpub fn new() -> Self {@@ -177,7 +178,7 @@ impl DiskManager {}/// Create a DiskManager given the configuration- #[allow(deprecated)]+ #[expect(deprecated)]#[deprecated(since = "48.0.0", note = "Use DiskManager::builder() instead")]pub fn try_new(config: DiskManagerConfig) -> Result<Arc<Self>> {match config {diff --git a/datafusion/execution/src/lib.rs b/datafusion/execution/src/lib.rsindex 1a8da9459a..aced2f46d7 100644--- a/datafusion/execution/src/lib.rs+++ b/datafusion/execution/src/lib.rs@@ -24,6 +24,7 @@// https://github.com/apache/datafusion/issues/11143#![deny(clippy::clone_on_ref_ptr)]#![cfg_attr(test, allow(clippy::needless_pass_by_value))]+#![deny(clippy::allow_attributes)]//! DataFusion execution configuration and runtime structuresdiff --git a/datafusion/execution/src/object_store.rs b/datafusion/execution/src/object_store.rsindex 6af7bf4c3d..22ce1f0cf2 100644--- a/datafusion/execution/src/object_store.rs+++ b/datafusion/execution/src/object_store.rs@@ -158,7 +158,7 @@ pub trait ObjectStoreRegistry: Send + Sync + std::fmt::Debug + 'static {/// Deregister the store previously registered with the same key. Returns the/// deregistered store if it existed.- #[allow(unused_variables)]+ #[expect(unused_variables)]fn deregister_store(&self, url: &Url) -> Result<Arc<dyn ObjectStore>> {not_impl_err!("ObjectStoreRegistry::deregister_store is not implemented for this ObjectStoreRegistry"diff --git a/datafusion/execution/src/runtime_env.rs b/datafusion/execution/src/runtime_env.rsindex 6613018765..e38a9f0854 100644--- a/datafusion/execution/src/runtime_env.rs+++ b/datafusion/execution/src/runtime_env.rs@@ -18,7 +18,7 @@//! Execution [`RuntimeEnv`] environment that manages access to object//! store, memory manager, disk manager.-#[allow(deprecated)]+#[expect(deprecated)]use crate::disk_manager::DiskManagerConfig;use crate::{disk_manager::{DiskManager, DiskManagerBuilder, DiskManagerMode},@@ -279,7 +279,7 @@ impl Default for RuntimeEnv {/// See example on [`RuntimeEnv`]#[derive(Clone)]pub struct RuntimeEnvBuilder {- #[allow(deprecated)]+ #[expect(deprecated)]/// DiskManager to manage temporary disk file usagepub disk_manager: DiskManagerConfig,/// DiskManager builder to manager temporary disk file usage@@ -317,7 +317,7 @@ impl RuntimeEnvBuilder {}}- #[allow(deprecated)]+ #[expect(deprecated)]#[deprecated(since = "48.0.0", note = "Use with_disk_manager_builder instead")]/// Customize disk managerpub fn with_disk_manager(mut self, disk_manager: DiskManagerConfig) -> Self {@@ -418,7 +418,7 @@ impl RuntimeEnvBuilder {disk_manager: if let Some(builder) = disk_manager_builder {Arc::new(builder.build()?)} else {- #[allow(deprecated)]+ #[expect(deprecated)]DiskManager::try_new(disk_manager)?},cache_manager: CacheManager::try_new(&cache_manager)?,@@ -451,7 +451,7 @@ impl RuntimeEnvBuilder {};Self {- #[allow(deprecated)]+ #[expect(deprecated)]disk_manager: DiskManagerConfig::Existing(Arc::clone(&runtime_env.disk_manager,)),diff --git a/datafusion/expr-common/src/dyn_eq.rs b/datafusion/expr-common/src/dyn_eq.rsindex e0ebcae487..75d9c06d67 100644--- a/datafusion/expr-common/src/dyn_eq.rs+++ b/datafusion/expr-common/src/dyn_eq.rs@@ -28,7 +28,7 @@ use std::hash::{Hash, Hasher};////// Note: This trait should not be implemented directly. Implement `Eq` and `Any` and use/// the blanket implementation.-#[allow(private_bounds)]+#[expect(private_bounds)]pub trait DynEq: private::EqSealed {fn dyn_eq(&self, other: &dyn Any) -> bool;}@@ -45,7 +45,7 @@ impl<T: Eq + Any> DynEq for T {////// Note: This trait should not be implemented directly. Implement `Hash` and `Any` and use/// the blanket implementation.-#[allow(private_bounds)]+#[expect(private_bounds)]pub trait DynHash: private::HashSealed {fn dyn_hash(&self, _state: &mut dyn Hasher);}diff --git a/datafusion/expr-common/src/lib.rs b/datafusion/expr-common/src/lib.rsindex 0018694d18..2be066beaa 100644--- a/datafusion/expr-common/src/lib.rs+++ b/datafusion/expr-common/src/lib.rs@@ -32,6 +32,7 @@// https://github.com/apache/datafusion/issues/11143#![deny(clippy::clone_on_ref_ptr)]#![cfg_attr(test, allow(clippy::needless_pass_by_value))]+#![deny(clippy::allow_attributes)]pub mod accumulator;pub mod casts;diff --git a/datafusion/expr/src/expr.rs b/datafusion/expr/src/expr.rsindex 088880e28b..c7d825ce1d 100644--- a/datafusion/expr/src/expr.rs+++ b/datafusion/expr/src/expr.rs@@ -2104,7 +2104,7 @@ impl Expr {impl Normalizeable for Expr {fn can_normalize(&self) -> bool {- #[allow(clippy::match_like_matches_macro)]+ #[expect(clippy::match_like_matches_macro)]match self {Expr::BinaryExpr(BinaryExpr {op:diff --git a/datafusion/expr/src/lib.rs b/datafusion/expr/src/lib.rsindex ec4942e9a8..b02254bb7d 100644--- a/datafusion/expr/src/lib.rs+++ b/datafusion/expr/src/lib.rs@@ -24,6 +24,7 @@// https://github.com/apache/datafusion/issues/11143#![deny(clippy::clone_on_ref_ptr)]#![cfg_attr(test, allow(clippy::needless_pass_by_value))]+#![deny(clippy::allow_attributes)]//! [DataFusion](https://github.com/apache/datafusion)//! is an extensible query execution framework that usesdiff --git a/datafusion/expr/src/logical_plan/plan.rs b/datafusion/expr/src/logical_plan/plan.rsindex c51be15b67..4219c24bfc 100644--- a/datafusion/expr/src/logical_plan/plan.rs+++ b/datafusion/expr/src/logical_plan/plan.rs@@ -3235,6 +3235,7 @@ impl PartialOrd for Analyze {// TODO(clippy): This clippy `allow` should be removed if// the manual `PartialEq` is removed in favor of a derive.// (see `PartialEq` the impl for details.)+#[allow(clippy::allow_attributes)]#[allow(clippy::derived_hash_with_manual_eq)]#[derive(Debug, Clone, Eq, Hash)]pub struct Extension {diff --git a/datafusion/expr/src/ptr_eq.rs b/datafusion/expr/src/ptr_eq.rsindex 0bbfba5e8d..79ea3d7219 100644--- a/datafusion/expr/src/ptr_eq.rs+++ b/datafusion/expr/src/ptr_eq.rs@@ -39,7 +39,7 @@ pub fn arc_ptr_hash<T: ?Sized>(a: &Arc<T>, hasher: &mut impl Hasher) {////// If you have pointers to a `dyn UDF impl` consider using [`super::udf_eq::UdfEq`].#[derive(Clone)]-#[allow(private_bounds)] // This is so that PtrEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse.+#[expect(private_bounds)] // This is so that PtrEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse.pub struct PtrEq<Ptr: PointerType>(Ptr);impl<T> PartialEq for PtrEq<Arc<T>>diff --git a/datafusion/expr/src/udf.rs b/datafusion/expr/src/udf.rsindex d275e1eb8e..437dca61b5 100644--- a/datafusion/expr/src/udf.rs+++ b/datafusion/expr/src/udf.rs@@ -228,7 +228,7 @@ impl ScalarUDF {#[deprecated(since = "50.0.0", note = "Use `return_field_from_args` instead.")]pub fn is_nullable(&self, args: &[Expr], schema: &dyn ExprSchema) -> bool {- #[allow(deprecated)]+ #[expect(deprecated)]self.inner.is_nullable(args, schema)}@@ -902,7 +902,7 @@ impl ScalarUDFImpl for AliasedScalarUDFImpl {}fn is_nullable(&self, args: &[Expr], schema: &dyn ExprSchema) -> bool {- #[allow(deprecated)]+ #[expect(deprecated)]self.inner.is_nullable(args, schema)}diff --git a/datafusion/expr/src/udf_eq.rs b/datafusion/expr/src/udf_eq.rsindex 6664495267..30cfb1d831 100644--- a/datafusion/expr/src/udf_eq.rs+++ b/datafusion/expr/src/udf_eq.rs@@ -26,7 +26,7 @@ use std::sync::Arc;////// If you want to just compare pointers for equality, use [`super::ptr_eq::PtrEq`].#[derive(Clone)]-#[allow(private_bounds)] // This is so that UdfEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse.+#[expect(private_bounds)] // This is so that UdfEq can only be used with allowed pointer types (e.g. Arc), without allowing misuse.pub struct UdfEq<Ptr: UdfPointer>(Ptr);impl<Ptr> PartialEq for UdfEq<Ptr>diff --git a/datafusion/proto-common/src/from_proto/mod.rs b/datafusion/proto-common/src/from_proto/mod.rsindex 73ece62eb8..c591a202af 100644--- a/datafusion/proto-common/src/from_proto/mod.rs+++ b/datafusion/proto-common/src/from_proto/mod.rs@@ -935,7 +935,6 @@ impl TryFrom<&protobuf::ParquetOptions> for ParquetOptions {fn try_from(value: &protobuf::ParquetOptions,) -> datafusion_common::Result<Self, Self::Error> {- #[allow(deprecated)] // max_statistics_sizeOk(ParquetOptions {enable_page_index: value.enable_page_index,pruning: value.pruning,@@ -1020,7 +1019,6 @@ impl TryFrom<&protobuf::ParquetColumnOptions> for ParquetColumnOptions {fn try_from(value: &protobuf::ParquetColumnOptions,) -> datafusion_common::Result<Self, Self::Error> {- #[allow(deprecated)] // max_statistics_sizeOk(ParquetColumnOptions {compression: value.compression_opt.clone().map(|opt| match opt {protobuf::parquet_column_options::CompressionOpt::Compression(v) => Some(v),diff --git a/datafusion/proto-common/src/generated/mod.rs b/datafusion/proto-common/src/generated/mod.rsindex 24a062e4ca..08cd75b622 100644--- a/datafusion/proto-common/src/generated/mod.rs+++ b/datafusion/proto-common/src/generated/mod.rs@@ -15,6 +15,7 @@// specific language governing permissions and limitations// under the License.+#[allow(clippy::allow_attributes)]#[allow(clippy::all)]#[rustfmt::skip]pub mod datafusion_proto_common {diff --git a/datafusion/proto-common/src/lib.rs b/datafusion/proto-common/src/lib.rsindex 6f7fb7b89c..b7e1c906d9 100644--- a/datafusion/proto-common/src/lib.rs+++ b/datafusion/proto-common/src/lib.rs@@ -24,6 +24,7 @@// Make sure fast / cheap clones on Arc are explicit:// https://github.com/apache/datafusion/issues/11143#![deny(clippy::clone_on_ref_ptr)]+#![deny(clippy::allow_attributes)]//! Serialize / Deserialize DataFusion Primitive Types to bytes//!