Skip to content

Commit e3c4232

Browse files
authored
Upgrade Rust toolchain from 1.86 to 1.89 (#456)
* Upgrade Rust toolchain from 1.86 to 1.89 * Fix Clippy issues
1 parent de40c71 commit e3c4232

File tree

10 files changed

+27
-17
lines changed

10 files changed

+27
-17
lines changed

README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ cargo run -p datafusion-table-providers --example flight-sql --features flight
178178
```
179179

180180
### ODBC
181+
181182
```bash
182183
apt-get install unixodbc-dev libsqliteodbc
183184
# or
@@ -191,18 +192,22 @@ cargo run --example odbc_sqlite --features odbc
191192
Please see https://github.com/pacman82/odbc-api#os-x-arm--mac-m1 for reference.
192193

193194
Steps:
195+
194196
1. Install unixodbc and sqliteodbc by `brew install unixodbc sqliteodbc`.
195197
2. Find local sqliteodbc driver path by running `brew info sqliteodbc`. The path might look like `/opt/homebrew/Cellar/sqliteodbc/0.99991`.
196198
3. Set up odbc config file at `~/.odbcinst.ini` with your local sqliteodbc path.
197-
Example config file:
199+
Example config file:
200+
198201
```
199202
[SQLite3]
200203
Description = SQLite3 ODBC Driver
201204
Driver = /opt/homebrew/Cellar/sqliteodbc/0.99991/lib/libsqlite3odbc.dylib
202205
```
206+
203207
4. Test configuration by running `odbcinst -q -d -n SQLite3`. If the path is printed out correctly, then you are all set.
204208

205209
## Examples (in Python)
210+
206211
1. Start a Python venv
207212
2. Enter into venv
208213
3. Inside python/ folder, run `maturin develop`.

core/src/duckdb/write.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -254,10 +254,13 @@ impl DataSink for DuckDBDataSink {
254254
let batch = batch.map_err(check_and_mark_retriable_error)?;
255255

256256
if let Some(constraints) = self.table_definition.constraints() {
257-
constraints::validate_batch_with_constraints(&[batch.clone()], constraints)
258-
.await
259-
.context(super::ConstraintViolationSnafu)
260-
.map_err(to_datafusion_error)?;
257+
constraints::validate_batch_with_constraints(
258+
std::slice::from_ref(&batch),
259+
constraints,
260+
)
261+
.await
262+
.context(super::ConstraintViolationSnafu)
263+
.map_err(to_datafusion_error)?;
261264
}
262265

263266
if let Err(send_error) = batch_tx.send(batch).await {

core/src/mysql/federation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ fn mysql_ast_analyzer(ast: ast::Statement) -> Result<ast::Statement, DataFusionE
5454
let mut new_query = query.clone();
5555

5656
let mut window_visitor = MySQLWindowVisitor::default();
57-
new_query.visit(&mut window_visitor);
57+
let _ = new_query.visit(&mut window_visitor);
5858

5959
Ok(ast::Statement::Query(new_query))
6060
}

core/src/mysql/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ impl DataSink for MySQLDataSink {
145145
num_rows += batch_num_rows as u64;
146146

147147
constraints::validate_batch_with_constraints(
148-
&[batch.clone()],
148+
std::slice::from_ref(&batch),
149149
self.mysql.constraints(),
150150
)
151151
.await

core/src/postgres/write.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ impl DataSink for PostgresDataSink {
204204
num_rows += batch_num_rows as u64;
205205

206206
constraints::validate_batch_with_constraints(
207-
&[batch.clone()],
207+
std::slice::from_ref(&batch),
208208
self.postgres.constraints(),
209209
)
210210
.await

core/src/sql/db_connection_pool/dbconnection.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,6 @@ pub async fn query_arrow<T, P>(
237237
.await
238238
.context(UnableToQueryArrowSnafu {})
239239
} else {
240-
return Err(Error::UnableToDowncastConnection {});
240+
Err(Error::UnableToDowncastConnection {})
241241
}
242242
}

core/src/sql/db_connection_pool/dbconnection/odbcconn.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ impl<T: InputParameter + Sync + Send + DynClone> ODBCSyncParameter for T {
6666
dyn_clone::clone_trait_object!(ODBCSyncParameter);
6767

6868
pub type ODBCParameter = Box<dyn ODBCSyncParameter>;
69-
pub type ODBCDbConnection<'a> = (dyn DbConnection<Connection<'a>, ODBCParameter>);
69+
pub type ODBCDbConnection<'a> = dyn DbConnection<Connection<'a>, ODBCParameter>;
7070
pub type ODBCDbConnectionPool<'a> =
7171
dyn DbConnectionPool<Connection<'a>, ODBCParameter> + Sync + Send;
7272

@@ -142,7 +142,6 @@ where
142142
unimplemented!()
143143
}
144144

145-
#[must_use]
146145
async fn get_schema(
147146
&self,
148147
table_reference: &TableReference,

core/src/sqlite/federation.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ fn sqlite_ast_analyzer(ast: ast::Statement) -> Result<ast::Statement, DataFusion
5656
// iterate over the query and find any INTERVAL statements
5757
// find the column they target, and replace the INTERVAL and column with e.g. datetime(column, '+1 day')
5858
let mut interval_visitor = SQLiteIntervalVisitor::default();
59-
new_query.visit(&mut interval_visitor);
59+
let _ = new_query.visit(&mut interval_visitor);
6060

6161
Ok(ast::Statement::Query(new_query))
6262
}

core/src/sqlite/write.rs

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,13 @@ impl DataSink for SqliteDataSink {
166166
DataFusionError::Execution(format!("Unable to convert num_rows() to u64: {e}"))
167167
})?;
168168

169-
constraints::validate_batch_with_constraints(&[data_batch.clone()], &constraints)
170-
.await
171-
.context(super::ConstraintViolationSnafu)
172-
.map_err(to_datafusion_error)?;
169+
constraints::validate_batch_with_constraints(
170+
std::slice::from_ref(&data_batch),
171+
&constraints,
172+
)
173+
.await
174+
.context(super::ConstraintViolationSnafu)
175+
.map_err(to_datafusion_error)?;
173176

174177
batch_tx.send(data_batch).await.map_err(|err| {
175178
DataFusionError::Execution(format!("Error sending data batch: {err}"))

rust-toolchain.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
[toolchain]
2-
channel = "1.86.0"
2+
channel = "1.89.0"
33
components = ["rustc", "cargo", "rustfmt", "clippy"]

0 commit comments

Comments
 (0)