Skip to content

Commit 8936386

Browse files
committed
chore(rust): downgrade msrv to 1.85
Signed-off-by: if0ne <pavel.agafonov.al@gmail.com>
1 parent 5498723 commit 8936386

15 files changed

Lines changed: 78 additions & 46 deletions

File tree

rust/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ resolver = "2"
2323
version = "0.23.0"
2424
description = "Rust implementation of Arrow Database Connectivity (ADBC)"
2525
edition = "2024"
26-
rust-version = "1.88"
26+
rust-version = "1.85"
2727
authors = ["Apache Arrow <dev@arrow.apache.org>"]
2828
license = "Apache-2.0"
2929
documentation = "https://docs.rs/adbc_core/"

rust/core/src/sync.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ use std::collections::HashSet;
2020
use arrow_array::{RecordBatch, RecordBatchReader};
2121
use arrow_schema::Schema;
2222

23+
use crate::PartitionedResult;
2324
use crate::error::Result;
2425
use crate::options::{self, OptionConnection, OptionDatabase, OptionStatement, OptionValue};
25-
use crate::PartitionedResult;
2626

2727
/// Ability to configure an object by setting/getting options.
2828
pub trait Optionable {

rust/driver/datafusion/tests/test_datafusion.rs

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,10 @@ fn test_get_objects_database() {
136136
fn test_execute_sql() {
137137
let mut connection = get_connection(None);
138138

139-
execute_update(&mut connection, "CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')");
139+
execute_update(
140+
&mut connection,
141+
"CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')",
142+
);
140143

141144
let batch = execute_sql_query(&mut connection, "SELECT * FROM datafusion.public.example");
142145

@@ -148,7 +151,10 @@ fn test_execute_sql() {
148151
fn test_ingest() {
149152
let mut connection = get_connection(None);
150153

151-
execute_update(&mut connection, "CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')");
154+
execute_update(
155+
&mut connection,
156+
"CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')",
157+
);
152158

153159
let batch = execute_sql_query(&mut connection, "SELECT * FROM datafusion.public.example");
154160

@@ -174,7 +180,10 @@ fn test_ingest() {
174180
fn test_execute_substrait() {
175181
let mut connection = get_connection(None);
176182

177-
execute_update(&mut connection, "CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')");
183+
execute_update(
184+
&mut connection,
185+
"CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')",
186+
);
178187

179188
let ctx = SessionContext::new();
180189

@@ -203,7 +212,10 @@ fn test_execute_substrait() {
203212
async fn test_running_in_async() {
204213
let mut connection = get_connection(Some(tokio::runtime::Handle::current()));
205214

206-
execute_update(&mut connection, "CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')");
215+
execute_update(
216+
&mut connection,
217+
"CREATE TABLE IF NOT EXISTS datafusion.public.example (c1 INT, c2 VARCHAR) AS VALUES(1,'HELLO'),(2,'DATAFUSION'),(3,'!')",
218+
);
207219

208220
let batch = execute_sql_query(&mut connection, "SELECT * FROM datafusion.public.example");
209221

rust/driver/dummy/tests/driver_exporter_dummy.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ use arrow_array::{Array, Float64Array, Int64Array, RecordBatch, RecordBatchReade
2626
use arrow_schema::{DataType, Field, Schema};
2727
use arrow_select::concat::concat_batches;
2828

29+
use adbc_core::Statement;
2930
use adbc_core::options::{
3031
AdbcVersion, InfoCode, IngestMode, IsolationLevel, ObjectDepth, OptionConnection,
3132
OptionDatabase, OptionStatement,
3233
};
33-
use adbc_core::Statement;
34-
use adbc_core::{schemas, Connection, Database, Driver, Optionable};
34+
use adbc_core::{Connection, Database, Driver, Optionable, schemas};
3535
use adbc_driver_manager::{ManagedConnection, ManagedDatabase, ManagedDriver, ManagedStatement};
3636

3737
use adbc_dummy::{DummyConnection, DummyDatabase, DummyDriver, DummyStatement, SingleBatchReader};

rust/driver/snowflake/src/connection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
use std::collections::HashSet;
2323

2424
use adbc_core::{
25+
Optionable,
2526
error::Result,
2627
options::{InfoCode, OptionConnection, OptionValue},
27-
Optionable,
2828
};
2929
use adbc_driver_manager::ManagedConnection;
3030
use arrow_array::RecordBatchReader;

rust/driver/snowflake/src/connection/builder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,14 @@
2222
use std::fmt;
2323

2424
use adbc_core::{
25+
Database as _,
2526
error::Result,
2627
options::{OptionConnection, OptionValue},
27-
Database as _,
2828
};
2929

30+
use crate::{Connection, Database, builder::BuilderIter};
3031
#[cfg(feature = "env")]
3132
use crate::{builder::env_parse_map_err, database};
32-
use crate::{builder::BuilderIter, Connection, Database};
3333

3434
/// A builder for [`Connection`].
3535
///

rust/driver/snowflake/src/database.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
use std::{collections::HashSet, ffi::c_int, sync::Arc};
2323

2424
use adbc_core::{
25+
Connection as _, Database as _, Optionable,
2526
error::{Error, Result, Status},
2627
options::{AdbcVersion, InfoCode, OptionConnection, OptionDatabase, OptionValue},
27-
Connection as _, Database as _, Optionable,
2828
};
2929
use adbc_driver_manager::ManagedDatabase;
3030
use arrow_array::{
31+
Array,
3132
cast::AsArray,
3233
types::{Int64Type, UInt32Type},
33-
Array,
3434
};
3535

3636
use crate::Connection;

rust/driver/snowflake/src/duration.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ fn overflow() -> Error {
4343
}
4444

4545
fn bad_input<T>() -> Result<T> {
46-
Err(invalid_arg("invalid duration (valid durations are a sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, 1.5h, 2h45m, valid time units are ns, us, ms, s, m, h)"))
46+
Err(invalid_arg(
47+
"invalid duration (valid durations are a sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, 1.5h, 2h45m, valid time units are ns, us, ms, s, m, h)",
48+
))
4749
}
4850

4951
/// Parse the given string to a [`Duration`], returning an error when parsing
@@ -260,7 +262,9 @@ mod tests {
260262
+ Duration::from_secs(48)
261263
+ Duration::from_nanos(372539828))
262264
);
263-
let bad_input = Err(invalid_arg("invalid duration (valid durations are a sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, 1.5h, 2h45m, valid time units are ns, us, ms, s, m, h)"));
265+
let bad_input = Err(invalid_arg(
266+
"invalid duration (valid durations are a sequence of decimal numbers, each with optional fraction and a unit suffix, such as 300ms, 1.5h, 2h45m, valid time units are ns, us, ms, s, m, h)",
267+
));
264268
assert_eq!(parse_duration(""), bad_input);
265269
assert_eq!(parse_duration("3"), bad_input);
266270
assert_eq!(parse_duration("-"), bad_input);

rust/driver/snowflake/src/statement.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@
2020
//!
2121
2222
use adbc_core::{
23+
Optionable, PartitionedResult,
2324
error::Result,
2425
options::{OptionStatement, OptionValue},
25-
Optionable, PartitionedResult,
2626
};
2727
use adbc_driver_manager::ManagedStatement;
2828
use arrow_array::{RecordBatch, RecordBatchReader};

rust/driver/snowflake/tests/driver.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@ mod tests {
3737
use std::{collections::HashSet, ops::Deref, sync::LazyLock};
3838

3939
use adbc_core::{
40+
Connection as _, Statement as _,
4041
error::{Error, Result},
4142
options::AdbcVersion,
42-
Connection as _, Statement as _,
4343
};
44-
use adbc_snowflake::{connection, database, driver, Connection, Database, Driver, Statement};
44+
use adbc_snowflake::{Connection, Database, Driver, Statement, connection, database, driver};
4545
use arrow_array::{cast::AsArray, types::Decimal128Type};
4646

4747
const ADBC_VERSION: AdbcVersion = AdbcVersion::V110;
@@ -81,9 +81,11 @@ mod tests {
8181
fn database_get_info() -> Result<()> {
8282
with_database(|mut database| {
8383
assert_eq!(database.vendor_name(), Ok("Snowflake".to_owned()));
84-
assert!(database
85-
.vendor_version()
86-
.is_ok_and(|version| version.starts_with("v")));
84+
assert!(
85+
database
86+
.vendor_version()
87+
.is_ok_and(|version| version.starts_with("v"))
88+
);
8789
assert!(database.vendor_arrow_version().is_ok());
8890
assert_eq!(database.vendor_sql(), Ok(true));
8991
assert_eq!(database.vendor_substrait(), Ok(false));
@@ -92,9 +94,11 @@ mod tests {
9294
Ok("ADBC Snowflake Driver - Go".to_owned())
9395
);
9496
assert!(database.driver_version().is_ok());
95-
assert!(database
96-
.driver_arrow_version()
97-
.is_ok_and(|version| version.starts_with("v")));
97+
assert!(
98+
database
99+
.driver_arrow_version()
100+
.is_ok_and(|version| version.starts_with("v"))
101+
);
98102
assert_eq!(database.adbc_version(), Ok(ADBC_VERSION));
99103
Ok(())
100104
})

0 commit comments

Comments
 (0)