Skip to content

Commit

Permalink
fix: pin pyarrow and run clippy
Browse files Browse the repository at this point in the history
Signed-off-by: Robert Pack <[email protected]>
Signed-off-by: JustinRush80 <[email protected]>
  • Loading branch information
roeap authored and JustinRush80 committed Jan 17, 2025
1 parent 209c2a6 commit 0a45cf0
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 23 deletions.
6 changes: 3 additions & 3 deletions crates/azure/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,19 +47,19 @@ impl ObjectStoreFactory for AzureFactory {
let config = config::AzureConfigHelper::try_new(options.as_azure_options())?.build()?;

let (_, path) =
ObjectStoreScheme::parse(&url).map_err(|e| DeltaTableError::GenericError {
ObjectStoreScheme::parse(url).map_err(|e| DeltaTableError::GenericError {
source: Box::new(e),
})?;
let prefix = Path::parse(path)?;

let mut builder = MicrosoftAzureBuilder::new().with_url(url.to_string());

for (key, value) in config.iter() {
builder = builder.with_config(key.clone(), value.clone());
builder = builder.with_config(*key, value.clone());
}

let inner = builder
.with_retry(self.parse_retry_config(&options)?)
.with_retry(self.parse_retry_config(options)?)
.build()?;

let store = limit_store_handler(url_prefix_handler(inner, prefix.clone()), options);
Expand Down
8 changes: 3 additions & 5 deletions crates/catalog-unity/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,9 @@ pub enum UnityCatalogError {

impl From<UnityCatalogError> for DataCatalogError {
fn from(value: UnityCatalogError) -> Self {
match value {
_ => DataCatalogError::Generic {
catalog: "Unity",
source: Box::new(value),
},
DataCatalogError::Generic {
catalog: "Unity",
source: Box::new(value),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/operations/add_column.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use delta_kernel::schema::StructType;
use futures::future::BoxFuture;
use itertools::Itertools;

use super::transaction::{CommitBuilder, CommitProperties, PROTOCOL};
use super::transaction::{CommitBuilder, CommitProperties};
use super::{CustomExecuteHandler, Operation};
use crate::kernel::{StructField, StructTypeExt};
use crate::logstore::LogStoreRef;
Expand Down
2 changes: 1 addition & 1 deletion crates/core/src/operations/merge/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -779,7 +779,7 @@ async fn execute(
if df
.clone()
.schema()
.field_with_unqualified_name(&col_name.to_string())
.field_with_unqualified_name(col_name)
.is_err()
// implies it doesn't exist
{
Expand Down
8 changes: 4 additions & 4 deletions crates/core/src/storage/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -356,21 +356,21 @@ pub trait RetryConfigParse {
}

if let Some(retry_timeout) = options.0.get("retry_timeout") {
retry_config.retry_timeout = parse_duration(&retry_timeout).map_err(|_| {
retry_config.retry_timeout = parse_duration(retry_timeout).map_err(|_| {
DeltaTableError::generic(format!("failed to parse \"{retry_timeout}\" as Duration"))
})?;
}

if let Some(bc_init_backoff) = options.0.get("backoff_config.init_backoff") {
retry_config.backoff.init_backoff = parse_duration(&bc_init_backoff).map_err(|_| {
retry_config.backoff.init_backoff = parse_duration(bc_init_backoff).map_err(|_| {
DeltaTableError::generic(format!(
"failed to parse \"{bc_init_backoff}\" as Duration"
))
})?;
}

if let Some(bc_max_backoff) = options.0.get("backoff_config.max_backoff") {
retry_config.backoff.max_backoff = parse_duration(&bc_max_backoff).map_err(|_| {
retry_config.backoff.max_backoff = parse_duration(bc_max_backoff).map_err(|_| {
DeltaTableError::generic(format!(
"failed to parse \"{bc_max_backoff}\" as Duration"
))
Expand Down Expand Up @@ -668,6 +668,6 @@ mod tests {
assert_eq!(retry_config.retry_timeout, Duration::from_secs(300));
assert_eq!(retry_config.backoff.init_backoff, Duration::from_secs(20));
assert_eq!(retry_config.backoff.max_backoff, Duration::from_secs(3600));
assert_eq!(retry_config.backoff.base, 50 as f64);
assert_eq!(retry_config.backoff.base, 50_f64);
}
}
6 changes: 3 additions & 3 deletions crates/gcp/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ impl ObjectStoreFactory for GcpFactory {
let config = config::GcpConfigHelper::try_new(options.as_gcp_options())?.build()?;

let (_, path) =
ObjectStoreScheme::parse(&url).map_err(|e| DeltaTableError::GenericError {
ObjectStoreScheme::parse(url).map_err(|e| DeltaTableError::GenericError {
source: Box::new(e),
})?;
let prefix = Path::parse(path)?;

let mut builder = GoogleCloudStorageBuilder::new().with_url(url.to_string());

for (key, value) in config.iter() {
builder = builder.with_config(key.clone(), value.clone());
builder = builder.with_config(*key, value.clone());
}

let inner = builder
.with_retry(self.parse_retry_config(&options)?)
.with_retry(self.parse_retry_config(options)?)
.build()?;

let gcs_backend = crate::storage::GcsStorageBackend::try_new(Arc::new(inner))?;
Expand Down
2 changes: 1 addition & 1 deletion crates/lakefs/src/storage.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ impl ObjectStoreFactory for LakeFSObjectStoreFactory {
let mut builder = AmazonS3Builder::new().with_url(s3_url.to_string());

for (key, value) in config.iter() {
builder = builder.with_config(key.clone(), value.clone());
builder = builder.with_config(*key, value.clone());
}

let inner = builder
Expand Down
2 changes: 1 addition & 1 deletion python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ classifiers = [
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
]
dependencies = ["pyarrow>=16"]
dependencies = ["pyarrow>=16,<19"]
dynamic = ["version"]

[project.optional-dependencies]
Expand Down
6 changes: 3 additions & 3 deletions python/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ pub enum PythonError {
ThreadingError(String),
}

impl<T> Into<PythonError> for std::sync::PoisonError<T> {
fn into(self) -> PythonError {
PythonError::ThreadingError(self.to_string())
impl<T> From<std::sync::PoisonError<T>> for PythonError {
fn from(val: std::sync::PoisonError<T>) -> Self {
PythonError::ThreadingError(val.to_string())
}
}

Expand Down
2 changes: 1 addition & 1 deletion python/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ impl RawDeltaTable {
._table
.lock()
.map_err(|e| PyRuntimeError::new_err(e.to_string()))?;
(*original).state = state;
original.state = state;
Ok(())
}
}
Expand Down

0 comments on commit 0a45cf0

Please sign in to comment.