You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@datafusion.apache.org by "kumarUjjawal (via GitHub)" <gi...@apache.org> on 2025/12/16 08:26:56 UTC
[PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
kumarUjjawal opened a new pull request, #19350:
URL: https://github.com/apache/datafusion/pull/19350
## 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
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.
<!--
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.
-->
## What changes are included in this PR?
Attributes changes for the following crates:
- datafusion-proto
- datafusion-pruning
- datafusion-session
<!--
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.
-->
## Are these changes tested?
Yes
<!--
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)?
-->
## 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.
-->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "kumarUjjawal (via GitHub)" <gi...@apache.org>.
kumarUjjawal commented on code in PR #19350:
URL: https://github.com/apache/datafusion/pull/19350#discussion_r2623034452
##########
datafusion/proto/src/generated/mod.rs:
##########
@@ -15,13 +15,16 @@
// specific language governing permissions and limitations
// under the License.
+#![allow(clippy::allow_attributes)]
+
#[allow(clippy::all)]
#[rustfmt::skip]
pub mod datafusion {
include!("prost.rs");
include!("datafusion_proto_common.rs");
#[cfg(feature = "json")]
+ #[allow(clippy::allow_attributes)]
Review Comment:
Good catch!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey merged PR #19350:
URL: https://github.com/apache/datafusion/pull/19350
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on PR #19350:
URL: https://github.com/apache/datafusion/pull/19350#issuecomment-3663624171
Thanks @kumarUjjawal
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #19350:
URL: https://github.com/apache/datafusion/pull/19350#discussion_r2622995380
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
Review Comment:
Not sure about the changes to this file; can we maintain the previous code whilst fixing the lints?
##########
datafusion/proto/src/generated/mod.rs:
##########
@@ -15,13 +15,16 @@
// specific language governing permissions and limitations
// under the License.
+#![allow(clippy::allow_attributes)]
+
#[allow(clippy::all)]
#[rustfmt::skip]
pub mod datafusion {
include!("prost.rs");
include!("datafusion_proto_common.rs");
#[cfg(feature = "json")]
+ #[allow(clippy::allow_attributes)]
Review Comment:
Is this not covered by the `#![allow(clippy::allow_attributes)]` above?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #19350:
URL: https://github.com/apache/datafusion/pull/19350#discussion_r2623585639
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
@@ -155,14 +155,26 @@ impl AsExecutionPlan for protobuf::PhysicalPlanNode {
PhysicalPlanType::JsonScan(scan) => {
self.try_into_json_scan_physical_plan(scan, ctx, extension_codec)
}
- #[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) => {
Review Comment:
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_attr`s 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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org
Re: [PR] chore: enforce clippy::allow_attributes for proto, pruning, session [datafusion]
Posted by "Jefffrey (via GitHub)" <gi...@apache.org>.
Jefffrey commented on code in PR #19350:
URL: https://github.com/apache/datafusion/pull/19350#discussion_r2625548688
##########
datafusion/proto/src/physical_plan/mod.rs:
##########
@@ -674,6 +672,7 @@ impl protobuf::PhysicalPlanNode {
}
#[cfg_attr(not(feature = "parquet"), allow(unused_variables))]
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: github-unsubscribe@datafusion.apache.org
For additional commands, e-mail: github-help@datafusion.apache.org