Skip to content

chore: ensuring default builds work without datafusion #3453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
May 22, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ jobs:
run: cargo fmt -- --check

- name: Default build
run: (cd crates/deltalake && cargo build)
run: (cd crates/deltalake && cargo build --tests)

- name: build and lint with clippy
run: cargo clippy --features ${{ env.DEFAULT_FEATURES }} --tests
Expand Down
12 changes: 12 additions & 0 deletions crates/core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -138,3 +138,15 @@ integration_test = []
[[test]]
name = "dat"
harness = false

[[test]]
name = "command_optimize"
required-features = ["datafusion"]

[[test]]
name = "command_merge"
required-features = ["datafusion"]

[[test]]
name = "command_restore"
required-features = ["datafusion"]
1 change: 1 addition & 0 deletions crates/core/src/kernel/transaction/application.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ mod tests {
protocol::SaveMode, writer::test_utils::get_record_batch, DeltaOps, DeltaTableBuilder,
};

#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_app_txn_workload() {
// Test that the transaction ids can be read from different scenarios
Expand Down
2 changes: 2 additions & 0 deletions crates/core/src/operations/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -551,6 +551,7 @@ mod tests {
assert_ne!(table.metadata().unwrap().id, first_id)
}

#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_create_or_replace_existing_table() {
let batch = get_record_batch(None, false);
Expand All @@ -576,6 +577,7 @@ mod tests {
}

#[tokio::test]
#[cfg(feature = "datafusion")]
async fn test_create_or_replace_existing_table_partitioned() {
let batch = get_record_batch(None, false);
let schema = get_delta_schema();
Expand Down
1 change: 1 addition & 0 deletions crates/core/src/operations/restore.rs
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ mod tests {
/// Verify that restore respects constraints that were added/removed in previous version_to_restore
/// <https://github.com/delta-io/delta-rs/issues/3352>
#[tokio::test]
#[cfg(feature = "datafusion")]
async fn test_simple_restore_constraints() -> DeltaResult<()> {
let batch = get_record_batch(None, false);
let table = DeltaOps(create_bare_table())
Expand Down
5 changes: 5 additions & 0 deletions crates/core/src/protocol/checkpoints.rs
Original file line number Diff line number Diff line change
Expand Up @@ -899,6 +899,7 @@ mod tests {
);
}

#[cfg(feature = "datafusion")]
async fn setup_table() -> DeltaTable {
use arrow_schema::{DataType, Field};
let schema = Arc::new(ArrowSchema::new(vec![Field::new(
Expand All @@ -923,6 +924,7 @@ mod tests {
.unwrap()
}

#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_cleanup_no_checkpoints() {
// Test that metadata clean up does not corrupt the table when no checkpoints exist
Expand Down Expand Up @@ -952,6 +954,7 @@ mod tests {
assert!(res.is_ok());
}

#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_cleanup_with_checkpoints() {
let table = setup_table().await;
Expand Down Expand Up @@ -1081,6 +1084,7 @@ mod tests {
);
}

#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_struct_with_single_list_field() {
// you need another column otherwise the entire stats struct is empty
Expand Down Expand Up @@ -1167,6 +1171,7 @@ mod tests {
});

#[ignore = "This test is only useful if the batch size has been made small"]
#[cfg(feature = "datafusion")]
#[tokio::test]
async fn test_checkpoint_large_table() -> DeltaResult<()> {
use crate::writer::test_utils::get_arrow_schema;
Expand Down
Loading