Skip to content

Commit

Permalink
Update arrow requirement from 31 to 32 (#116)
Browse files Browse the repository at this point in the history
* Update arrow requirement from 31 to 32

Updates the requirements on [arrow](https://github.com/apache/arrow-rs) to permit the latest version.
- [Release notes](https://github.com/apache/arrow-rs/releases)
- [Changelog](https://github.com/apache/arrow-rs/blob/master/CHANGELOG.md)
- [Commits](https://github.com/apache/arrow-rs/commits)

---
updated-dependencies:
- dependency-name: arrow
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

* fix clippy

Change-Id: I6ebc6d404c353d72d637f53b082ce6c18544023c

* fix clippy error

Change-Id: I73b224022bf4a1431ebea2cdb8f6a0bd99b5657d

* fix clippy error

Change-Id: I7b75656301e43974d405e032050374b875ba0c28

* use master

Change-Id: Ief0eef1c0815d0b94e1d1504e7aba1c5282033a3

* update tarpaulin

Change-Id: Ibb6a593ee6080b7479a333ec40442c22f0d7086a

* use master

Change-Id: Ie26c48d7b1f3dbad09ac4a4d00840e3c05615af1

* update

Change-Id: Ia9034a0e3cb30b35a96ba24b15d8e5dc33613717

* use 0.16

Change-Id: I718dc77e78c6f2175875166b328f03262d577932

* update version

Change-Id: I0d1cd6482bb7fa63575b34d796580bc5203e159b

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: wangfenjin <wangfenj@gmail.com>
  • Loading branch information
dependabot[bot] and wangfenjin authored Feb 1, 2023
1 parent 5f14a40 commit 9c76a72
Show file tree
Hide file tree
Showing 17 changed files with 59 additions and 62 deletions.
1 change: 1 addition & 0 deletions .github/workflows/rust.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ jobs:
# Intentionally omit time feature until we're on time 0.3, at which
# point it should be added to `bundled-full`.
args: '--features "buildtime_bindgen" --features "modern-full" --avoid-cfg-tarpaulin' # TODO restore to normal (https://github.com/xd009642/tarpaulin/issues/756#issuecomment-838769320)
version: 0.22.0
env:
DUCKDB_LIB_DIR: ${{ github.workspace }}/libduckdb
DUCKDB_INCLUDE_DIR: ${{ github.workspace }}/libduckdb
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ memchr = "2.3"
uuid = { version = "1.0", optional = true }
smallvec = "1.6.1"
cast = { version = "0.3", features = ["std"] }
arrow = { version = "31", default-features = false, features = ["prettyprint", "ffi"] }
arrow = { version = "32", default-features = false, features = ["prettyprint", "ffi"] }
rust_decimal = "1.14"
strum = { version = "0.24", features = ["derive"] }
r2d2 = { version = "0.8.9", optional = true }
Expand Down
2 changes: 1 addition & 1 deletion libduckdb-sys/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,4 @@ cc = { version = "1.0", features = ["parallel"], optional = true }
vcpkg = { version = "0.2", optional = true }

[dev-dependencies]
arrow = { version = "31", default-features = false, features = ["ffi"] }
arrow = { version = "32", default-features = false, features = ["ffi"] }
26 changes: 13 additions & 13 deletions libduckdb-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ mod build_bundled {
#[cfg(feature = "buildtime_bindgen")]
{
use super::{bindings, HeaderLocation};
let header = HeaderLocation::FromPath(format!("{}/duckdb.h", lib_name));
let header = HeaderLocation::FromPath(format!("{lib_name}/duckdb.h"));
bindings::write_to_out_dir(header, out_path);
}
#[cfg(not(feature = "buildtime_bindgen"))]
Expand All @@ -60,10 +60,10 @@ mod build_bundled {
fs::copy(format!("{}/bindgen_bundled_version.rs", lib_name), out_path)
.expect("Could not copy bindings to output directory");
}
println!("cargo:rerun-if-changed={}/duckdb.hpp", lib_name);
println!("cargo:rerun-if-changed={}/duckdb.cpp", lib_name);
println!("cargo:rerun-if-changed={lib_name}/duckdb.hpp");
println!("cargo:rerun-if-changed={lib_name}/duckdb.cpp");
let mut cfg = cc::Build::new();
cfg.file(format!("{}/duckdb.cpp", lib_name))
cfg.file(format!("{lib_name}/duckdb.cpp"))
.cpp(true)
.flag_if_supported("-std=c++11")
.flag_if_supported("-stdlib=libc++")
Expand All @@ -77,7 +77,7 @@ mod build_bundled {

cfg.compile(lib_name);

println!("cargo:lib_dir={}", out_dir);
println!("cargo:lib_dir={out_dir}");
}
}

Expand All @@ -100,7 +100,7 @@ impl From<HeaderLocation> for String {
match header {
HeaderLocation::FromEnvironment => {
let prefix = env_prefix();
let mut header = env::var(format!("{}_INCLUDE_DIR", prefix))
let mut header = env::var(format!("{prefix}_INCLUDE_DIR"))
.unwrap_or_else(|_| env::var(format!("{}_LIB_DIR", env_prefix())).unwrap());
header.push_str("/duckdb.h");
header
Expand Down Expand Up @@ -162,23 +162,23 @@ mod build_linked {
// `links=` value in our Cargo.toml) to get this value. This might be
// useful if you need to ensure whatever crypto library sqlcipher relies
// on is available, for example.
println!("cargo:link-target={}", link_lib);
println!("cargo:link-target={link_lib}");

if win_target() && cfg!(feature = "winduckdb") {
println!("cargo:rustc-link-lib=dylib={}", link_lib);
println!("cargo:rustc-link-lib=dylib={link_lib}");
return HeaderLocation::Wrapper;
}

// Allow users to specify where to find DuckDB.
if let Ok(dir) = env::var(format!("{}_LIB_DIR", env_prefix())) {
println!("cargo:rustc-env=LD_LIBRARY_PATH={}", dir);
println!("cargo:rustc-env=LD_LIBRARY_PATH={dir}");
// Try to use pkg-config to determine link commands
let pkgconfig_path = Path::new(&dir).join("pkgconfig");
env::set_var("PKG_CONFIG_PATH", pkgconfig_path);
if pkg_config::Config::new().probe(link_lib).is_err() {
// Otherwise just emit the bare minimum link commands.
println!("cargo:rustc-link-lib={}={}", find_link_mode(), link_lib);
println!("cargo:rustc-link-search={}", dir);
println!("cargo:rustc-link-search={dir}");
}
return HeaderLocation::FromEnvironment;
}
Expand Down Expand Up @@ -241,7 +241,7 @@ mod bindings {
.parse_callbacks(Box::new(bindgen::CargoCallbacks))
.rustfmt_bindings(true)
.generate()
.unwrap_or_else(|_| panic!("could not run bindgen on header {}", header))
.unwrap_or_else(|_| panic!("could not run bindgen on header {header}"))
.write(Box::new(&mut output))
.expect("could not write output of bindgen");
let output = String::from_utf8(output).expect("bindgen output was not UTF-8?!");
Expand All @@ -250,9 +250,9 @@ mod bindings {
.truncate(true)
.create(true)
.open(out_path)
.unwrap_or_else(|_| panic!("Could not write to {:?}", out_path));
.unwrap_or_else(|_| panic!("Could not write to {out_path:?}"));

file.write_all(output.as_bytes())
.unwrap_or_else(|_| panic!("Could not write to {:?}", out_path));
.unwrap_or_else(|_| panic!("Could not write to {out_path:?}"));
}
}
2 changes: 1 addition & 1 deletion libduckdb-sys/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ mod tests {
for row_idx in 0..duckdb_row_count(&mut result) {
for col_idx in 0..duckdb_column_count(&mut result) {
let val = duckdb_value_int32(&mut result, col_idx, row_idx);
print!("{} ", val);
print!("{val} ");
}
println!();
}
Expand Down
4 changes: 2 additions & 2 deletions src/column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ mod test {
assert_eq!(ty, Type::Int);
}
e => {
panic!("Unexpected error type: {:?}", e);
panic!("Unexpected error type: {e:?}");
}
}
match row.get::<_, String>("y").unwrap_err() {
Expand All @@ -194,7 +194,7 @@ mod test {
assert_eq!(ty, Type::Null);
}
e => {
panic!("Unexpected error type: {:?}", e);
panic!("Unexpected error type: {e:?}");
}
}
Ok(())
Expand Down
2 changes: 1 addition & 1 deletion src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ impl Config {
if state != ffi::DuckDBSuccess {
return Err(Error::DuckDBFailure(
ffi::Error::new(state),
Some(format!("set {}:{} error", key, value)),
Some(format!("set {key}:{value} error")),
));
}
Ok(())
Expand Down
26 changes: 12 additions & 14 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,40 +145,38 @@ impl fmt::Display for Error {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Error::DuckDBFailure(ref err, None) => err.fmt(f),
Error::DuckDBFailure(_, Some(ref s)) => write!(f, "{}", s),
Error::DuckDBFailure(_, Some(ref s)) => write!(f, "{s}"),
Error::FromSqlConversionFailure(i, ref t, ref err) => {
if i != UNKNOWN_COLUMN {
write!(f, "Conversion error from type {} at index: {}, {}", t, i, err)
write!(f, "Conversion error from type {t} at index: {i}, {err}")
} else {
err.fmt(f)
}
}
Error::IntegralValueOutOfRange(col, val) => {
if col != UNKNOWN_COLUMN {
write!(f, "Integer {} out of range at index {}", val, col)
write!(f, "Integer {val} out of range at index {col}")
} else {
write!(f, "Integer {} out of range", val)
write!(f, "Integer {val} out of range")
}
}
Error::Utf8Error(ref err) => err.fmt(f),
Error::NulError(ref err) => err.fmt(f),
Error::InvalidParameterName(ref name) => write!(f, "Invalid parameter name: {}", name),
Error::InvalidParameterName(ref name) => write!(f, "Invalid parameter name: {name}"),
Error::InvalidPath(ref p) => write!(f, "Invalid path: {}", p.to_string_lossy()),
Error::ExecuteReturnedResults => {
write!(f, "Execute returned results - did you mean to call query?")
}
Error::QueryReturnedNoRows => write!(f, "Query returned no rows"),
Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {}", i),
Error::InvalidColumnName(ref name) => write!(f, "Invalid column name: {}", name),
Error::InvalidColumnIndex(i) => write!(f, "Invalid column index: {i}"),
Error::InvalidColumnName(ref name) => write!(f, "Invalid column name: {name}"),
Error::InvalidColumnType(i, ref name, ref t) => {
write!(f, "Invalid column type {} at index: {}, name: {}", t, i, name)
write!(f, "Invalid column type {t} at index: {i}, name: {name}")
}
Error::InvalidParameterCount(i1, n1) => write!(
f,
"Wrong number of parameters passed to query. Got {}, needed {}",
i1, n1
),
Error::StatementChangedRows(i) => write!(f, "Query changed {} rows", i),
Error::InvalidParameterCount(i1, n1) => {
write!(f, "Wrong number of parameters passed to query. Got {i1}, needed {n1}")
}
Error::StatementChangedRows(i) => write!(f, "Query changed {i} rows"),
Error::ToSqlConversionFailure(ref err) => err.fmt(f),
Error::InvalidQuery => write!(f, "Query is not read-only"),
Error::MultipleStatement => write!(f, "Multiple statements provided"),
Expand Down
4 changes: 2 additions & 2 deletions src/inner_connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -117,9 +117,9 @@ impl Drop for InnerConnection {
use std::thread::panicking;
if let Err(e) = self.close() {
if panicking() {
eprintln!("Error while closing DuckDB connection: {:?}", e);
eprintln!("Error while closing DuckDB connection: {e:?}");
} else {
panic!("Error while closing DuckDB connection: {:?}", e);
panic!("Error while closing DuckDB connection: {e:?}");
}
}
}
Expand Down
30 changes: 14 additions & 16 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl<'a> fmt::Display for DatabaseName<'a> {
match *self {
DatabaseName::Main => write!(f, "main"),
DatabaseName::Temp => write!(f, "temp"),
DatabaseName::Attached(s) => write!(f, "{}", s),
DatabaseName::Attached(s) => write!(f, "{s}"),
}
}
}
Expand Down Expand Up @@ -655,9 +655,7 @@ mod test {
// assert_eq!(ErrorCode::CannotOpen, e.code);
assert!(
msg.contains(filename),
"error message '{}' does not contain '{}'",
msg,
filename
"error message '{msg}' does not contain '{filename}'"
);
} else {
panic!("DuckDBFailure expected");
Expand Down Expand Up @@ -854,7 +852,7 @@ mod test {
let result: Result<i64> = db.query_row("SELECT x FROM foo WHERE x > 5", [], |r| r.get(0));
match result.unwrap_err() {
Error::QueryReturnedNoRows => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let bad_query_result = db.query_row("NOT A PROPER QUERY; test123", [], |_| Ok(()));
Expand Down Expand Up @@ -910,7 +908,7 @@ mod test {
let query = "SELECT 12345";
let stmt = db.prepare(query)?;

assert!(format!("{:?}", stmt).contains(query));
assert!(format!("{stmt:?}").contains(query));
Ok(())
}

Expand All @@ -927,7 +925,7 @@ mod test {
// TODO(wangfenjin): Update errorcode
assert_eq!(err.code, ErrorCode::Unknown);
}
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}
Ok(())
}
Expand Down Expand Up @@ -975,7 +973,7 @@ mod test {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
match *self {
CustomError::SomeError => write!(f, "my custom error"),
CustomError::Sqlite(ref se) => write!(f, "my custom error: {}", se),
CustomError::Sqlite(ref se) => write!(f, "my custom error: {se}"),
}
}
}
Expand Down Expand Up @@ -1037,14 +1035,14 @@ mod test {

match bad_type.unwrap_err() {
Error::InvalidColumnType(..) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let bad_idx: Result<Vec<String>> = query.query_and_then([], |row| row.get(3))?.collect();

match bad_idx.unwrap_err() {
Error::InvalidColumnIndex(_) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}
Ok(())
}
Expand Down Expand Up @@ -1089,7 +1087,7 @@ mod test {

match bad_type.unwrap_err() {
CustomError::Sqlite(Error::InvalidColumnType(..)) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let bad_idx: CustomResult<Vec<String>> = query
Expand All @@ -1098,15 +1096,15 @@ mod test {

match bad_idx.unwrap_err() {
CustomError::Sqlite(Error::InvalidColumnIndex(_)) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let non_sqlite_err: CustomResult<Vec<String>> =
query.query_and_then([], |_| Err(CustomError::SomeError))?.collect();

match non_sqlite_err.unwrap_err() {
CustomError::SomeError => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}
Ok(())
}
Expand Down Expand Up @@ -1143,23 +1141,23 @@ mod test {

match bad_type.unwrap_err() {
CustomError::Sqlite(Error::InvalidColumnType(..)) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let bad_idx: CustomResult<String> =
db.query_row_and_then(query, [], |row| row.get(3).map_err(CustomError::Sqlite));

match bad_idx.unwrap_err() {
CustomError::Sqlite(Error::InvalidColumnIndex(_)) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}

let non_sqlite_err: CustomResult<String> =
db.query_row_and_then(query, [], |_| Err(CustomError::SomeError));

match non_sqlite_err.unwrap_err() {
CustomError::SomeError => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/pragma.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ impl Sql {
} else {
Err(Error::DuckDBFailure(
ffi::Error::new(ffi::DuckDBError),
Some(format!("Invalid keyword \"{}\"", keyword)),
Some(format!("Invalid keyword \"{keyword}\"")),
))
}
}
Expand Down Expand Up @@ -74,7 +74,7 @@ impl Sql {
_ => {
return Err(Error::DuckDBFailure(
ffi::Error::new(ffi::DuckDBError),
Some(format!("Unsupported value \"{:?}\"", value)),
Some(format!("Unsupported value \"{value:?}\"")),
));
}
};
Expand Down
2 changes: 1 addition & 1 deletion src/statement.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ mod test {
let mut multi = db.prepare("INSERT INTO foo (x) SELECT 3 UNION ALL SELECT 4")?;
match multi.insert([]).unwrap_err() {
Error::StatementChangedRows(2) => (),
err => panic!("Unexpected error {}", err),
err => panic!("Unexpected error {err}"),
}
Ok(())
}
Expand Down
4 changes: 2 additions & 2 deletions src/transaction.rs
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ impl Savepoint<'_> {
#[inline]
fn with_depth_and_name<T: Into<String>>(conn: &Connection, depth: u32, name: T) -> Result<Savepoint<'_>> {
let name = name.into();
conn.execute_batch(&format!("SAVEPOINT {}", name)).map(|_| Savepoint {
conn.execute_batch(&format!("SAVEPOINT {name}")).map(|_| Savepoint {
conn,
name,
depth,
Expand All @@ -260,7 +260,7 @@ impl Savepoint<'_> {

#[inline]
fn with_depth(conn: &Connection, depth: u32) -> Result<Savepoint<'_>> {
let name = format!("_duckdb_sp_{}", depth);
let name = format!("_duckdb_sp_{depth}");
Savepoint::with_depth_and_name(conn, depth, name)
}

Expand Down
2 changes: 1 addition & 1 deletion src/types/chrono.rs
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ mod test {
[Utc::now()],
|r| r.get(0),
);
println!("{:?}", result);
println!("{result:?}");
assert!(result.is_ok());
Ok(())
}
Expand Down
Loading

0 comments on commit 9c76a72

Please sign in to comment.