Skip to content

Commit 64656c2

Browse files
committed
chore: rework the arrow integration tests
This now relies on the features explicitly supported by the kernel crate rather than released arrow versions which may or may not be supported
1 parent 760583c commit 64656c2

File tree

3 files changed

+16
-43
lines changed

3 files changed

+16
-43
lines changed

integration-tests/Cargo.toml

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -6,19 +6,4 @@ edition = "2021"
66
[workspace]
77

88
[dependencies]
9-
arrow = "=53.0.0"
10-
delta_kernel = { path = "../kernel", features = ["arrow-conversion", "arrow-expression", "default-engine", "sync-engine"] }
11-
12-
[patch.'file:///../kernel']
13-
arrow = "=53.0.0"
14-
arrow-arith = "=53.0.0"
15-
arrow-array = "=53.0.0"
16-
arrow-buffer = "=53.0.0"
17-
arrow-cast = "=53.0.0"
18-
arrow-data = "=53.0.0"
19-
arrow-ord = "=53.0.0"
20-
arrow-json = "=53.0.0"
21-
arrow-select = "=53.0.0"
22-
arrow-schema = "=53.0.0"
23-
parquet = "=53.0.0"
24-
object_store = "=0.11.1"
9+
delta_kernel = { path = "../kernel", features = ["default-engine", "sync-engine"] }

integration-tests/src/main.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
fn create_arrow_schema() -> arrow::datatypes::Schema {
2-
use arrow::datatypes::{DataType, Field, Schema};
1+
use delta_kernel::arrow::datatypes::{DataType, Field, Schema};
2+
3+
fn create_arrow_schema() -> Schema {
34
let field_a = Field::new("a", DataType::Int64, false);
45
let field_b = Field::new("b", DataType::Boolean, false);
56
Schema::new(vec![field_a, field_b])
67
}
78

89
fn create_kernel_schema() -> delta_kernel::schema::Schema {
9-
use delta_kernel::schema::{DataType, Schema, StructField};
10+
use delta_kernel::schema::{DataType, StructField};
1011
let field_a = StructField::not_null("a", DataType::LONG);
1112
let field_b = StructField::not_null("b", DataType::BOOLEAN);
12-
Schema::new(vec![field_a, field_b])
13+
delta_kernel::schema::Schema::new(vec![field_a, field_b])
1314
}
1415

1516
fn main() {

integration-tests/test-all-arrow-versions.sh

Lines changed: 10 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,38 +2,25 @@
22

33
set -eu -o pipefail
44

5-
is_version_le() {
6-
[ "$1" = "$(echo -e "$1\n$2" | sort -V | head -n1)" ]
7-
}
8-
9-
is_version_lt() {
10-
if [ "$1" = "$2" ]
11-
then
12-
return 1
13-
else
14-
is_version_le "$1" "$2"
15-
fi
16-
}
17-
185
test_arrow_version() {
196
ARROW_VERSION="$1"
207
echo "== Testing version $ARROW_VERSION =="
21-
sed -i'' -e "s/\(arrow[^\"]*=[^\"]*\).*/\1\"=$ARROW_VERSION\"/" Cargo.toml
22-
sed -i'' -e "s/\(parquet[^\"]*\).*/\1\"=$ARROW_VERSION\"/" Cargo.toml
238
cargo clean
249
rm -f Cargo.lock
2510
cargo update
2611
cat Cargo.toml
27-
cargo run
12+
cargo run --features ${ARROW_VERSION}
2813
}
2914

30-
MIN_ARROW_VER="53.0.0"
31-
MAX_ARROW_VER="54.0.0"
15+
FEATURES=$(cat ../kernel/Cargo.toml | grep -e ^arrow_ | awk '{ print $1 }' | sort -u)
3216

33-
for ARROW_VERSION in $(curl -s https://crates.io/api/v1/crates/arrow | jq -r '.versions[].num' | tr -d '\r')
17+
18+
echo "[features]" >> Cargo.toml
19+
20+
for ARROW_VERSION in ${FEATURES}
3421
do
35-
if ! is_version_lt "$ARROW_VERSION" "$MIN_ARROW_VER" && is_version_lt "$ARROW_VERSION" "$MAX_ARROW_VER"
36-
then
37-
test_arrow_version "$ARROW_VERSION"
38-
fi
22+
echo "${ARROW_VERSION} = [\"delta_kernel/${ARROW_VERSION}\"]" >> Cargo.toml
23+
test_arrow_version $ARROW_VERSION
3924
done
25+
26+
git checkout Cargo.toml

0 commit comments

Comments
 (0)