Skip to content

Commit 02c647a

Browse files
authored
chore: enforce clippy::allow_attributes for optimizer and macros (#19310)
## 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-macros - datafusion-optimizer <!-- 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. -->
1 parent 933657e commit 02c647a

21 files changed

+29
-29
lines changed

datafusion/core/src/execution/session_state_defaults.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ impl SessionStateDefaults {
103103

104104
/// returns the list of default [`ScalarUDF`]s
105105
pub fn default_scalar_functions() -> Vec<Arc<ScalarUDF>> {
106-
#[cfg_attr(not(feature = "nested_expressions"), allow(unused_mut))]
106+
#[cfg_attr(not(feature = "nested_expressions"), expect(unused_mut))]
107107
let mut functions: Vec<Arc<ScalarUDF>> = functions::all_default_functions();
108108

109109
#[cfg(feature = "nested_expressions")]
@@ -155,7 +155,7 @@ impl SessionStateDefaults {
155155
}
156156

157157
/// registers all the builtin array functions
158-
#[cfg_attr(not(feature = "nested_expressions"), allow(unused_variables))]
158+
#[cfg_attr(not(feature = "nested_expressions"), expect(unused_variables))]
159159
pub fn register_array_functions(state: &mut SessionState) {
160160
// register crate of array expressions (if enabled)
161161
#[cfg(feature = "nested_expressions")]

datafusion/macros/src/user_doc.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
html_favicon_url = "https://raw.githubusercontent.com/apache/datafusion/19fe44cf2f30cbdd63d4a4f52c74055163c6cc38/docs/logos/standalone_logo/logo_original.svg"
2121
)]
2222
#![cfg_attr(docsrs, feature(doc_cfg))]
23+
#![deny(clippy::allow_attributes)]
2324

2425
extern crate proc_macro;
2526
use datafusion_doc::scalar_doc_sections::doc_sections_const;

datafusion/optimizer/src/decorrelate_lateral_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ use datafusion_expr::{LogicalPlan, LogicalPlanBuilder};
3737
pub struct DecorrelateLateralJoin {}
3838

3939
impl DecorrelateLateralJoin {
40-
#[allow(missing_docs)]
40+
#[expect(missing_docs)]
4141
pub fn new() -> Self {
4242
Self::default()
4343
}

datafusion/optimizer/src/decorrelate_predicate_subquery.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ use log::debug;
4444
pub struct DecorrelatePredicateSubquery {}
4545

4646
impl DecorrelatePredicateSubquery {
47-
#[allow(missing_docs)]
47+
#[expect(missing_docs)]
4848
pub fn new() -> Self {
4949
Self::default()
5050
}

datafusion/optimizer/src/eliminate_cross_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ use datafusion_expr::{ExprSchemable, Operator, and, build_join_schema};
3333
pub struct EliminateCrossJoin;
3434

3535
impl EliminateCrossJoin {
36-
#[allow(missing_docs)]
36+
#[expect(missing_docs)]
3737
pub fn new() -> Self {
3838
Self {}
3939
}

datafusion/optimizer/src/eliminate_duplicated_expr.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ use indexmap::IndexSet;
3232
pub struct EliminateDuplicatedExpr;
3333

3434
impl EliminateDuplicatedExpr {
35-
#[allow(missing_docs)]
35+
#[expect(missing_docs)]
3636
pub fn new() -> Self {
3737
Self {}
3838
}

datafusion/optimizer/src/eliminate_filter.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use crate::{OptimizerConfig, OptimizerRule};
3434
pub struct EliminateFilter;
3535

3636
impl EliminateFilter {
37-
#[allow(missing_docs)]
37+
#[expect(missing_docs)]
3838
pub fn new() -> Self {
3939
Self {}
4040
}

datafusion/optimizer/src/eliminate_limit.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use std::sync::Arc;
3434
pub struct EliminateLimit;
3535

3636
impl EliminateLimit {
37-
#[allow(missing_docs)]
37+
#[expect(missing_docs)]
3838
pub fn new() -> Self {
3939
Self {}
4040
}
@@ -77,7 +77,7 @@ impl OptimizerRule for EliminateLimit {
7777
} else if matches!(limit.get_skip_type()?, SkipType::Literal(0)) {
7878
// If fetch is `None` and skip is 0, then Limit takes no effect and
7979
// we can remove it. Its input also can be Limit, so we should apply again.
80-
#[allow(clippy::used_underscore_binding)]
80+
#[expect(clippy::used_underscore_binding)]
8181
return self.rewrite(Arc::unwrap_or_clone(limit.input), _config);
8282
}
8383
Ok(Transformed::no(LogicalPlan::Limit(limit)))

datafusion/optimizer/src/eliminate_outer_join.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ use std::sync::Arc;
5252
pub struct EliminateOuterJoin;
5353

5454
impl EliminateOuterJoin {
55-
#[allow(missing_docs)]
55+
#[expect(missing_docs)]
5656
pub fn new() -> Self {
5757
Self {}
5858
}

datafusion/optimizer/src/extract_equijoin_predicate.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ type EquijoinPredicate = (Expr, Expr);
4242
pub struct ExtractEquijoinPredicate;
4343

4444
impl ExtractEquijoinPredicate {
45-
#[allow(missing_docs)]
45+
#[expect(missing_docs)]
4646
pub fn new() -> Self {
4747
Self {}
4848
}

0 commit comments

Comments
 (0)