Skip to content

chore: enforce clippy::allow_attributes for proto, pruning, session#19350

Merged
Jefffrey merged 7 commits intoapache:mainfrom
kumarUjjawal:chore/allow_attr_proto_prunning_session
Dec 17, 2025
Merged

chore: enforce clippy::allow_attributes for proto, pruning, session#19350
Jefffrey merged 7 commits intoapache:mainfrom
kumarUjjawal:chore/allow_attr_proto_prunning_session

Conversation

@kumarUjjawal
Copy link
Contributor

Which issue does this PR close?

Rationale for this change

We want to use #[expect] in place of #[allow] on the workspace level but to get there we wanted to do this in few crates at a time before enabling it in workspace.

What changes are included in this PR?

Attributes changes for the following crates:

  • datafusion-proto
  • datafusion-pruning
  • datafusion-session

Are these changes tested?

Yes

Are there any user-facing changes?

@github-actions github-actions bot added the proto Related to proto crate label Dec 16, 2025
@Jefffrey Jefffrey mentioned this pull request Dec 16, 2025
38 tasks
include!("datafusion_proto_common.rs");

#[cfg(feature = "json")]
#[allow(clippy::allow_attributes)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this not covered by the #![allow(clippy::allow_attributes)] above?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the changes to this file; can we maintain the previous code whilst fixing the lints?

Comment on lines 158 to 169
#[cfg_attr(not(feature = "parquet"), allow(unused_variables))]
#[cfg(feature = "parquet")]
PhysicalPlanType::ParquetScan(scan) => {
self.try_into_parquet_scan_physical_plan(scan, ctx, extension_codec)
}
#[cfg_attr(not(feature = "avro"), allow(unused_variables))]
#[cfg(not(feature = "parquet"))]
PhysicalPlanType::ParquetScan(_) => {
panic!(
"Unable to process a Parquet PhysicalPlan when `parquet` feature is not enabled"
)
}
#[cfg(feature = "avro")]
PhysicalPlanType::AvroScan(scan) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I still don't see why these changes are necessary to fix the lints 🤔

Can we just keep things simple? I believe we can just remove these cfg_attrs and at the actual functions (e.g. try_into_parquet_scan_physical_plan) we fix the lint to use expect. I don't expect code changes other than to attributes

@Jefffrey Jefffrey added this pull request to the merge queue Dec 17, 2025
Merged via the queue into apache:main with commit 7900cd6 Dec 17, 2025
27 checks passed
@Jefffrey
Copy link
Contributor

Thanks @kumarUjjawal

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

proto Related to proto crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants