From 1efd1fe013276a8df582784d0ecf0286eaae1539 Mon Sep 17 00:00:00 2001 From: Stephen Carman Date: Wed, 13 Dec 2023 14:34:23 -0500 Subject: [PATCH] feat: CHECK constraints addressing a lint --- crates/deltalake-core/src/operations/constraints.rs | 9 +++------ .../src/operations/transaction/protocol.rs | 2 ++ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/crates/deltalake-core/src/operations/constraints.rs b/crates/deltalake-core/src/operations/constraints.rs index 734c9a24a6..889e668b1a 100644 --- a/crates/deltalake-core/src/operations/constraints.rs +++ b/crates/deltalake-core/src/operations/constraints.rs @@ -186,7 +186,7 @@ impl std::future::IntoFuture for ConstraintBuilder { Action::Protocol(protocol), ]; - let _version = commit( + let version = commit( this.log_store.as_ref(), &actions, operations, @@ -195,11 +195,8 @@ impl std::future::IntoFuture for ConstraintBuilder { ) .await?; - this.snapshot.merge( - DeltaTableState::from_actions(actions, _version)?, - true, - true, - ); + this.snapshot + .merge(DeltaTableState::from_actions(actions, version)?, true, true); Ok(DeltaTable::new_with_state(this.log_store, this.snapshot)) }) } diff --git a/crates/deltalake-core/src/operations/transaction/protocol.rs b/crates/deltalake-core/src/operations/transaction/protocol.rs index 9c20755935..8d350f26dd 100644 --- a/crates/deltalake-core/src/operations/transaction/protocol.rs +++ b/crates/deltalake-core/src/operations/transaction/protocol.rs @@ -169,7 +169,9 @@ pub static INSTANCE: Lazy = Lazy::new(|| { let mut writer_features = HashSet::new(); writer_features.insert(WriterFeatures::AppendOnly); + #[cfg(feature = "datafusion")] writer_features.insert(WriterFeatures::Invariants); + #[cfg(feature = "datafusion")] writer_features.insert(WriterFeatures::CheckConstraints); // writer_features.insert(WriterFeatures::ChangeDataFeed); // writer_features.insert(WriterFeatures::GeneratedColumns);