Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
roeap committed Nov 5, 2023
1 parent db8b5e2 commit f23410f
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 17 deletions.
1 change: 1 addition & 0 deletions crates/deltalake-core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ tempfile = "3"
tokio = { version = "1", features = ["macros", "rt-multi-thread"] }
utime = "0.3"
hyper = { version = "0.14", features = ["server"] }
criterion = "0.5"

[features]
azure = ["object_store/azure"]
Expand Down
4 changes: 2 additions & 2 deletions crates/deltalake-core/benches/read_checkpoint.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use criterion::{criterion_group, criterion_main, Criterion};
use deltalake::table::state::DeltaTableState;
use deltalake::DeltaTableConfig;
use deltalake_core::table::state::DeltaTableState;
use deltalake_core::DeltaTableConfig;
use std::fs::File;
use std::io::Read;

Expand Down
23 changes: 8 additions & 15 deletions crates/deltalake-core/src/operations/transaction/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,11 @@ impl ProtocolChecker {
.difference(&self.reader_features)
.cloned()
.collect();
if diff.is_empty() {
Ok(())
} else {
Err(TransactionError::UnsupportedReaderFeatures(diff))
if !diff.is_empty() {
return Err(TransactionError::UnsupportedReaderFeatures(diff));
}
} else {
return Ok(());
}
};
Ok(())
}

/// Check if delta-rs can write to the given delta table.
Expand All @@ -108,15 +105,11 @@ impl ProtocolChecker {
.difference(&self.writer_features)
.cloned()
.collect();
if diff.is_empty() {
Ok(())
} else {
Err(TransactionError::UnsupportedWriterFeatures(diff))
if !diff.is_empty() {
return Err(TransactionError::UnsupportedWriterFeatures(diff));
}
} else {
// TODO: check if this is correct
Ok(())
}
};
Ok(())
}
}

Expand Down

0 comments on commit f23410f

Please sign in to comment.