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 488b024aa3 chore: bump workspace rust version to 1.91.0 (#18422)
488b024aa3 is described below
commit 488b024aa3d22a63fb159157ac165682a627d1f5
Author: Randy <[email protected]>
AuthorDate: Sun Nov 2 12:20:37 2025 +0800
chore: bump workspace rust version to 1.91.0 (#18422)
## Which issue does this PR close?
- Closes #18396
## Rationale for this change
## What changes are included in this PR?
- Bumps version in rust-toolchain.toml
- Fixes clippy errors
## Are these changes tested?
N/A
## Are there any user-facing changes?
N/A
---------
Co-authored-by: Jeffrey Vo <[email protected]>
---
datafusion/common/src/pyarrow.rs | 2 +-
datafusion/common/src/scalar/mod.rs | 2 +-
datafusion/core/src/dataframe/mod.rs | 2 +-
.../core/src/execution/session_state_defaults.rs | 8 ++++----
.../core/tests/fuzz_cases/equivalence/projection.rs | 4 ++--
datafusion/core/tests/optimizer/mod.rs | 2 +-
datafusion/datasource/src/file_stream.rs | 8 ++------
datafusion/execution/src/disk_manager.rs | 20 +++++---------------
datafusion/expr/src/expr_rewriter/mod.rs | 2 +-
datafusion/expr/src/udwf.rs | 2 +-
datafusion/ffi/src/udtf.rs | 3 +--
datafusion/functions/src/datetime/date_bin.rs | 4 ++--
datafusion/functions/src/datetime/date_trunc.rs | 4 ++--
datafusion/functions/src/math/log.rs | 4 ++--
.../optimizer/src/simplify_expressions/guarantees.rs | 10 +++++-----
datafusion/physical-expr/src/expressions/case.rs | 2 +-
datafusion/physical-expr/src/intervals/cp_solver.rs | 4 ++--
datafusion/physical-expr/src/projection.rs | 2 +-
.../physical-optimizer/src/enforce_sorting/mod.rs | 2 +-
datafusion/physical-optimizer/src/utils.rs | 4 ++--
.../physical-plan/src/joins/stream_join_utils.rs | 2 +-
datafusion/physical-plan/src/repartition/mod.rs | 8 ++------
datafusion/physical-plan/src/tree_node.rs | 6 +++---
rust-toolchain.toml | 2 +-
24 files changed, 45 insertions(+), 64 deletions(-)
diff --git a/datafusion/common/src/pyarrow.rs b/datafusion/common/src/pyarrow.rs
index 3b7d80b3da..18c6739735 100644
--- a/datafusion/common/src/pyarrow.rs
+++ b/datafusion/common/src/pyarrow.rs
@@ -126,7 +126,7 @@ mod tests {
fn test_roundtrip() {
init_python();
- let example_scalars = vec![
+ let example_scalars = [
ScalarValue::Boolean(Some(true)),
ScalarValue::Int32(Some(23)),
ScalarValue::Float64(Some(12.34)),
diff --git a/datafusion/common/src/scalar/mod.rs
b/datafusion/common/src/scalar/mod.rs
index f2546040ff..188a169a3d 100644
--- a/datafusion/common/src/scalar/mod.rs
+++ b/datafusion/common/src/scalar/mod.rs
@@ -8693,7 +8693,7 @@ mod tests {
])),
true,
));
- let scalars = vec![
+ let scalars = [
ScalarValue::try_new_null(&DataType::List(Arc::clone(&field_ref))).unwrap(),
ScalarValue::try_new_null(&DataType::LargeList(Arc::clone(&field_ref)))
.unwrap(),
diff --git a/datafusion/core/src/dataframe/mod.rs
b/datafusion/core/src/dataframe/mod.rs
index 965181b27c..98804e424b 100644
--- a/datafusion/core/src/dataframe/mod.rs
+++ b/datafusion/core/src/dataframe/mod.rs
@@ -983,7 +983,7 @@ impl DataFrame {
}));
//collect recordBatch
- let describe_record_batch = vec![
+ let describe_record_batch = [
// count aggregation
self.clone().aggregate(
vec![],
diff --git a/datafusion/core/src/execution/session_state_defaults.rs
b/datafusion/core/src/execution/session_state_defaults.rs
index baf396f3f1..62a575541a 100644
--- a/datafusion/core/src/execution/session_state_defaults.rs
+++ b/datafusion/core/src/execution/session_state_defaults.rs
@@ -101,7 +101,7 @@ impl SessionStateDefaults {
expr_planners
}
- /// returns the list of default [`ScalarUDF']'s
+ /// returns the list of default [`ScalarUDF`]s
pub fn default_scalar_functions() -> Vec<Arc<ScalarUDF>> {
#[cfg_attr(not(feature = "nested_expressions"), allow(unused_mut))]
let mut functions: Vec<Arc<ScalarUDF>> =
functions::all_default_functions();
@@ -112,12 +112,12 @@ impl SessionStateDefaults {
functions
}
- /// returns the list of default [`AggregateUDF']'s
+ /// returns the list of default [`AggregateUDF`]s
pub fn default_aggregate_functions() -> Vec<Arc<AggregateUDF>> {
functions_aggregate::all_default_aggregate_functions()
}
- /// returns the list of default [`WindowUDF']'s
+ /// returns the list of default [`WindowUDF`]s
pub fn default_window_functions() -> Vec<Arc<WindowUDF>> {
functions_window::all_default_window_functions()
}
@@ -127,7 +127,7 @@ impl SessionStateDefaults {
functions_table::all_default_table_functions()
}
- /// returns the list of default [`FileFormatFactory']'s
+ /// returns the list of default [`FileFormatFactory`]s
pub fn default_file_formats() -> Vec<Arc<dyn FileFormatFactory>> {
let file_formats: Vec<Arc<dyn FileFormatFactory>> = vec![
#[cfg(feature = "parquet")]
diff --git a/datafusion/core/tests/fuzz_cases/equivalence/projection.rs
b/datafusion/core/tests/fuzz_cases/equivalence/projection.rs
index 69639b3e09..a72a1558b2 100644
--- a/datafusion/core/tests/fuzz_cases/equivalence/projection.rs
+++ b/datafusion/core/tests/fuzz_cases/equivalence/projection.rs
@@ -58,7 +58,7 @@ fn project_orderings_random() -> Result<()> {
Operator::Plus,
col("b", &test_schema)?,
)) as Arc<dyn PhysicalExpr>;
- let proj_exprs = vec![
+ let proj_exprs = [
(col("a", &test_schema)?, "a_new"),
(col("b", &test_schema)?, "b_new"),
(col("c", &test_schema)?, "c_new"),
@@ -132,7 +132,7 @@ fn ordering_satisfy_after_projection_random() -> Result<()>
{
Operator::Plus,
col("b", &test_schema)?,
)) as Arc<dyn PhysicalExpr>;
- let proj_exprs = vec![
+ let proj_exprs = [
(col("a", &test_schema)?, "a_new"),
(col("b", &test_schema)?, "b_new"),
(col("c", &test_schema)?, "c_new"),
diff --git a/datafusion/core/tests/optimizer/mod.rs
b/datafusion/core/tests/optimizer/mod.rs
index aec32d0562..9b2a559682 100644
--- a/datafusion/core/tests/optimizer/mod.rs
+++ b/datafusion/core/tests/optimizer/mod.rs
@@ -287,7 +287,7 @@ fn test_nested_schema_nullability() {
#[test]
fn test_inequalities_non_null_bounded() {
- let guarantees = vec![
+ let guarantees = [
// x ∈ [1, 3] (not null)
(
col("x"),
diff --git a/datafusion/datasource/src/file_stream.rs
b/datafusion/datasource/src/file_stream.rs
index 9fee5691be..a4a43ca9ae 100644
--- a/datafusion/datasource/src/file_stream.rs
+++ b/datafusion/datasource/src/file_stream.rs
@@ -338,19 +338,15 @@ pub type FileOpenFuture =
BoxFuture<'static, Result<BoxStream<'static, Result<RecordBatch>>>>;
/// Describes the behavior of the `FileStream` if file opening or scanning
fails
+#[derive(Default)]
pub enum OnError {
/// Fail the entire stream and return the underlying error
+ #[default]
Fail,
/// Continue scanning, ignoring the failed file
Skip,
}
-impl Default for OnError {
- fn default() -> Self {
- Self::Fail
- }
-}
-
/// Generic API for opening a file using an [`ObjectStore`] and resolving to a
/// stream of [`RecordBatch`]
///
diff --git a/datafusion/execution/src/disk_manager.rs
b/datafusion/execution/src/disk_manager.rs
index 82f2d75ac1..c3aa1bfa29 100644
--- a/datafusion/execution/src/disk_manager.rs
+++ b/datafusion/execution/src/disk_manager.rs
@@ -98,10 +98,11 @@ impl DiskManagerBuilder {
}
}
-#[derive(Clone, Debug)]
+#[derive(Clone, Debug, Default)]
pub enum DiskManagerMode {
/// Create a new [DiskManager] that creates temporary files within
/// a temporary directory chosen by the OS
+ #[default]
OsTmpDirectory,
/// Create a new [DiskManager] that creates temporary files within
@@ -113,21 +114,17 @@ pub enum DiskManagerMode {
Disabled,
}
-impl Default for DiskManagerMode {
- fn default() -> Self {
- Self::OsTmpDirectory
- }
-}
-
/// Configuration for temporary disk access
+#[allow(deprecated)]
#[deprecated(since = "48.0.0", note = "Use DiskManagerBuilder instead")]
-#[derive(Debug, Clone)]
+#[derive(Debug, Clone, Default)]
pub enum DiskManagerConfig {
/// Use the provided [DiskManager] instance
Existing(Arc<DiskManager>),
/// Create a new [DiskManager] that creates temporary files within
/// a temporary directory chosen by the OS
+ #[default]
NewOs,
/// Create a new [DiskManager] that creates temporary files within
@@ -138,13 +135,6 @@ pub enum DiskManagerConfig {
Disabled,
}
-#[allow(deprecated)]
-impl Default for DiskManagerConfig {
- fn default() -> Self {
- Self::NewOs
- }
-}
-
#[allow(deprecated)]
impl DiskManagerConfig {
/// Create temporary files in a temporary directory chosen by the OS
diff --git a/datafusion/expr/src/expr_rewriter/mod.rs
b/datafusion/expr/src/expr_rewriter/mod.rs
index d9fb9f7219..9c3c5df700 100644
--- a/datafusion/expr/src/expr_rewriter/mod.rs
+++ b/datafusion/expr/src/expr_rewriter/mod.rs
@@ -434,7 +434,7 @@ mod test {
vec![Some("tableC".into()), Some("tableC".into())],
vec!["f", "ff"],
);
- let schemas = vec![schema_c, schema_f, schema_b, schema_a];
+ let schemas = [schema_c, schema_f, schema_b, schema_a];
let schemas = schemas.iter().collect::<Vec<_>>();
let normalized_expr =
diff --git a/datafusion/expr/src/udwf.rs b/datafusion/expr/src/udwf.rs
index 7ca2f0662d..3220fdcbca 100644
--- a/datafusion/expr/src/udwf.rs
+++ b/datafusion/expr/src/udwf.rs
@@ -355,7 +355,7 @@ pub trait WindowUDFImpl: Debug + DynEq + DynHash + Send +
Sync {
/// optimizations manually for specific UDFs.
///
/// Example:
- /// [`advanced_udwf.rs`]:
<https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udwf.rs>
+ /// `advanced_udwf.rs`:
<https://github.com/apache/arrow-datafusion/blob/main/datafusion-examples/examples/advanced_udwf.rs>
///
/// # Returns
/// [None] if simplify is not defined or,
diff --git a/datafusion/ffi/src/udtf.rs b/datafusion/ffi/src/udtf.rs
index ceedec2599..edd5273c70 100644
--- a/datafusion/ffi/src/udtf.rs
+++ b/datafusion/ffi/src/udtf.rs
@@ -293,8 +293,7 @@ mod tests {
let foreign_udf: ForeignTableFunction = local_udtf.into();
- let table =
- foreign_udf.call(&vec![lit(6_u64), lit("one"), lit(2.0),
lit(3_u64)])?;
+ let table = foreign_udf.call(&[lit(6_u64), lit("one"), lit(2.0),
lit(3_u64)])?;
let ctx = SessionContext::default();
let _ = ctx.register_table("test-table", table)?;
diff --git a/datafusion/functions/src/datetime/date_bin.rs
b/datafusion/functions/src/datetime/date_bin.rs
index c4e89743bd..92af123dba 100644
--- a/datafusion/functions/src/datetime/date_bin.rs
+++ b/datafusion/functions/src/datetime/date_bin.rs
@@ -743,7 +743,7 @@ mod tests {
#[test]
fn test_date_bin_timezones() {
- let cases = vec![
+ let cases = [
(
vec![
"2020-09-08T00:00:00Z",
@@ -883,7 +883,7 @@ mod tests {
#[test]
fn test_date_bin_single() {
- let cases = vec![
+ let cases = [
(
(
TimeDelta::try_minutes(15),
diff --git a/datafusion/functions/src/datetime/date_trunc.rs
b/datafusion/functions/src/datetime/date_trunc.rs
index 1a75232b45..913e6217af 100644
--- a/datafusion/functions/src/datetime/date_trunc.rs
+++ b/datafusion/functions/src/datetime/date_trunc.rs
@@ -736,7 +736,7 @@ mod tests {
#[test]
fn test_date_trunc_timezones() {
- let cases = vec![
+ let cases = [
(
vec![
"2020-09-08T00:00:00Z",
@@ -909,7 +909,7 @@ mod tests {
#[test]
fn test_date_trunc_hour_timezones() {
- let cases = vec![
+ let cases = [
(
vec![
"2020-09-08T00:30:00Z",
diff --git a/datafusion/functions/src/math/log.rs
b/datafusion/functions/src/math/log.rs
index ff1fd0cd4b..f66f6fcfc1 100644
--- a/datafusion/functions/src/math/log.rs
+++ b/datafusion/functions/src/math/log.rs
@@ -720,7 +720,7 @@ mod tests {
#[test]
fn test_log_output_ordering() {
// [Unordered, Ascending, Descending, Literal]
- let orders = vec![
+ let orders = [
ExprProperties::new_unknown(),
ExprProperties::new_unknown().with_order(SortProperties::Ordered(
SortOptions {
@@ -755,7 +755,7 @@ mod tests {
results.push(result);
}
}
- let expected = vec![
+ let expected = [
// base: Unordered
SortProperties::Unordered,
SortProperties::Unordered,
diff --git a/datafusion/optimizer/src/simplify_expressions/guarantees.rs
b/datafusion/optimizer/src/simplify_expressions/guarantees.rs
index bbb023cfba..515fd29003 100644
--- a/datafusion/optimizer/src/simplify_expressions/guarantees.rs
+++ b/datafusion/optimizer/src/simplify_expressions/guarantees.rs
@@ -211,7 +211,7 @@ mod tests {
#[test]
fn test_null_handling() {
// IsNull / IsNotNull can be rewritten to true / false
- let guarantees = vec![
+ let guarantees = [
// Note: AlwaysNull case handled by test_column_single_value test,
// since it's a special case of a column with a single value.
(
@@ -261,7 +261,7 @@ mod tests {
#[test]
fn test_inequalities_non_null_unbounded() {
- let guarantees = vec![
+ let guarantees = [
// y ∈ [2021-01-01, ∞) (not null)
(
col("x"),
@@ -340,7 +340,7 @@ mod tests {
#[test]
fn test_inequalities_maybe_null() {
- let guarantees = vec![
+ let guarantees = [
// x ∈ ("abc", "def"]? (maybe null)
(
col("x"),
@@ -411,7 +411,7 @@ mod tests {
];
for scalar in scalars {
- let guarantees = vec![(col("x"),
NullableInterval::from(scalar.clone()))];
+ let guarantees = [(col("x"),
NullableInterval::from(scalar.clone()))];
let mut rewriter = GuaranteeRewriter::new(guarantees.iter());
let output = col("x").rewrite(&mut rewriter).data().unwrap();
@@ -421,7 +421,7 @@ mod tests {
#[test]
fn test_in_list() {
- let guarantees = vec![
+ let guarantees = [
// x ∈ [1, 10] (not null)
(
col("x"),
diff --git a/datafusion/physical-expr/src/expressions/case.rs
b/datafusion/physical-expr/src/expressions/case.rs
index 9ffb571a26..010df564a9 100644
--- a/datafusion/physical-expr/src/expressions/case.rs
+++ b/datafusion/physical-expr/src/expressions/case.rs
@@ -2154,7 +2154,7 @@ mod tests {
PartialResultIndex::try_new(2).unwrap(),
];
- let merged = merge(&vec![a1, a2, a3], &indices).unwrap();
+ let merged = merge(&[a1, a2, a3], &indices).unwrap();
let merged = merged.as_string::<i32>();
assert_eq!(merged.len(), indices.len());
diff --git a/datafusion/physical-expr/src/intervals/cp_solver.rs
b/datafusion/physical-expr/src/intervals/cp_solver.rs
index be0e5e1fa6..573cc88db7 100644
--- a/datafusion/physical-expr/src/intervals/cp_solver.rs
+++ b/datafusion/physical-expr/src/intervals/cp_solver.rs
@@ -791,11 +791,11 @@ mod tests {
result: PropagationResult,
schema: &Schema,
) -> Result<()> {
- let col_stats = vec![
+ let col_stats = [
(Arc::clone(&exprs_with_interval.0), left_interval),
(Arc::clone(&exprs_with_interval.1), right_interval),
];
- let expected = vec![
+ let expected = [
(Arc::clone(&exprs_with_interval.0), left_expected),
(Arc::clone(&exprs_with_interval.1), right_expected),
];
diff --git a/datafusion/physical-expr/src/projection.rs
b/datafusion/physical-expr/src/projection.rs
index c707d3ccff..a120ab427e 100644
--- a/datafusion/physical-expr/src/projection.rs
+++ b/datafusion/physical-expr/src/projection.rs
@@ -1360,7 +1360,7 @@ pub(crate) mod tests {
Arc::clone(col_b_new),
)) as Arc<dyn PhysicalExpr>;
- let test_cases = vec![
+ let test_cases = [
// ---------- TEST CASE 1 ------------
(
// orderings
diff --git a/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
b/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
index 8a71b28486..28d187bbf8 100644
--- a/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
+++ b/datafusion/physical-optimizer/src/enforce_sorting/mod.rs
@@ -91,7 +91,7 @@ impl EnforceSorting {
/// via its children.
pub type PlanWithCorrespondingSort = PlanContext<bool>;
-/// For a given node, update the [`PlanContext.data`] attribute.
+/// For a given node, update the `PlanContext.data` attribute.
///
/// If the node is a `SortExec`, or any of the node's children are a
`SortExec`,
/// then set the attribute to true.
diff --git a/datafusion/physical-optimizer/src/utils.rs
b/datafusion/physical-optimizer/src/utils.rs
index 3655e555a7..13a1745216 100644
--- a/datafusion/physical-optimizer/src/utils.rs
+++ b/datafusion/physical-optimizer/src/utils.rs
@@ -32,8 +32,8 @@ use datafusion_physical_plan::{ExecutionPlan,
ExecutionPlanProperties};
/// This utility function adds a `SortExec` above an operator according to the
/// given ordering requirements while preserving the original partitioning.
///
-/// Note that this updates the plan in both the [`PlanContext.children`] and
-/// the [`PlanContext.plan`]'s children. Therefore its not required to sync
+/// Note that this updates the plan in both the `PlanContext.children` and
+/// the `PlanContext.plan`'s children. Therefore its not required to sync
/// the child plans with [`PlanContext::update_plan_from_children`].
pub fn add_sort_above<T: Clone + Default>(
node: PlanContext<T>,
diff --git a/datafusion/physical-plan/src/joins/stream_join_utils.rs
b/datafusion/physical-plan/src/joins/stream_join_utils.rs
index 3e4cbc5d33..80221a7799 100644
--- a/datafusion/physical-plan/src/joins/stream_join_utils.rs
+++ b/datafusion/physical-plan/src/joins/stream_join_utils.rs
@@ -286,7 +286,7 @@ pub fn map_origin_col_to_filter_col(
/// the [`convert_filter_columns`] function.
/// 5. Searches for the converted filter expression in the filter expression
using the
/// [`check_filter_expr_contains_sort_information`] function.
-/// 6. If an exact match is found, returns the converted filter expression as
[`Some(Arc<dyn PhysicalExpr>)`].
+/// 6. If an exact match is found, returns the converted filter expression as
`Some(Arc<dyn PhysicalExpr>)`.
/// 7. If all columns are not included or an exact match is not found, returns
[`None`].
///
/// Examples:
diff --git a/datafusion/physical-plan/src/repartition/mod.rs
b/datafusion/physical-plan/src/repartition/mod.rs
index 2128304e07..08fac9fc69 100644
--- a/datafusion/physical-plan/src/repartition/mod.rs
+++ b/datafusion/physical-plan/src/repartition/mod.rs
@@ -110,9 +110,11 @@ struct ConsumingInputStreamsState {
}
/// Inner state of [`RepartitionExec`].
+#[derive(Default)]
enum RepartitionExecState {
/// Not initialized yet. This is the default state stored in the
RepartitionExec node
/// upon instantiation.
+ #[default]
NotInitialized,
/// Input streams are initialized, but they are still not being consumed.
The node
/// transitions to this state when the arrow's RecordBatch stream is
created in
@@ -123,12 +125,6 @@ enum RepartitionExecState {
ConsumingInputStreams(ConsumingInputStreamsState),
}
-impl Default for RepartitionExecState {
- fn default() -> Self {
- Self::NotInitialized
- }
-}
-
impl Debug for RepartitionExecState {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
match self {
diff --git a/datafusion/physical-plan/src/tree_node.rs
b/datafusion/physical-plan/src/tree_node.rs
index 78ba984ed1..85d7b33575 100644
--- a/datafusion/physical-plan/src/tree_node.rs
+++ b/datafusion/physical-plan/src/tree_node.rs
@@ -42,8 +42,8 @@ impl DynTreeNode for dyn ExecutionPlan {
/// A node context object beneficial for writing optimizer rules.
/// This context encapsulating an [`ExecutionPlan`] node with a payload.
///
-/// Since each wrapped node has it's children within both the
[`PlanContext.plan.children()`],
-/// as well as separately within the [`PlanContext.children`] (which are child
nodes wrapped in the context),
+/// Since each wrapped node has it's children within both the
`PlanContext.plan.children()`,
+/// as well as separately within the `PlanContext.children` (which are child
nodes wrapped in the context),
/// it's important to keep these child plans in sync when performing mutations.
///
/// Since there are two ways to access child plans directly -— it's recommended
@@ -69,7 +69,7 @@ impl<T> PlanContext<T> {
}
}
- /// Update the [`PlanContext.plan.children()`] from the
[`PlanContext.children`],
+ /// Update the `PlanContext.plan.children()` from the
`PlanContext.children`,
/// if the `PlanContext.children` have been changed.
pub fn update_plan_from_children(mut self) -> Result<Self> {
let children_plans = self.children.iter().map(|c|
Arc::clone(&c.plan)).collect();
diff --git a/rust-toolchain.toml b/rust-toolchain.toml
index 7697bc1c1e..22666a1b45 100644
--- a/rust-toolchain.toml
+++ b/rust-toolchain.toml
@@ -19,5 +19,5 @@
# to compile this workspace and run CI jobs.
[toolchain]
-channel = "1.90.0"
+channel = "1.91.0"
components = ["rustfmt", "clippy"]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]