Skip to content

Commit 77f29cc

Browse files
authored
chore(rust): separate adbc_core and adbc_datafusion arrow version requirements (#3017)
Context #2739 Closes #2524 Since datafusion tends to require newer versions of arrow than adbc_core, the version of arrow used by adbc_core will be bumped by adbc_datafusion when compiling the entire workspace. This PullRequest separates the arrow requirements for adbc_datafusion and others. Since the newer arrow that meets adbc_datafusion requirements will be used when the entire workspace is compiled, a job to test other than adbc_datafuion by generating a file that locks the lower requirements on CI is added. It make sure adbc_core will work with the older arrow.
1 parent 7804b2c commit 77f29cc

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

.github/workflows/rust.yml

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,16 @@ jobs:
4646
matrix:
4747
# TODO(alexandreyc): add `windows-latest`
4848
# See: https://github.com/apache/arrow-adbc/pull/1803#issuecomment-2117669300
49-
os: [macos-13, macos-latest, ubuntu-latest]
50-
name: "Rust ${{ matrix.os }}"
49+
os:
50+
- macos-13
51+
- macos-latest
52+
- ubuntu-latest
53+
minimal-versions:
54+
- false
55+
include:
56+
- os: ubuntu-latest
57+
minimal-versions: true # Test can be built with older arrow except adbc_datafusion
58+
name: Rust ${{ matrix.os }} ${{ matrix.minimal-versions && '(minimal versions for adbc_core)' || '' }}
5159
runs-on: ${{ matrix.os }}
5260
env:
5361
CARGO_INCREMENTAL: 0
@@ -57,6 +65,12 @@ jobs:
5765
with:
5866
fetch-depth: 0
5967
persist-credentials: false
68+
- name: Cargo update for minimal (arrow) version
69+
if: ${{ matrix.minimal-versions }}
70+
working-directory: rust
71+
run: |
72+
rustup toolchain install nightly
73+
cargo +nightly generate-lockfile -Z direct-minimal-versions
6074
- name: Use stable Rust
6175
id: rust
6276
run: |
@@ -120,27 +134,28 @@ jobs:
120134
- name: Set search dir for Snowflake Go lib
121135
run: echo "ADBC_SNOWFLAKE_GO_LIB_DIR=${{ github.workspace }}/local/lib" >> "$GITHUB_ENV"
122136
- name: Clippy
137+
if: ${{ ! matrix.minimal-versions }}
123138
working-directory: rust
124139
run: |
125140
cargo clippy --workspace --all-targets --all-features --locked -- -Dwarnings
126141
- name: Test
127142
working-directory: rust
128143
run: |
129-
cargo test --workspace --all-targets --all-features
144+
cargo test --all-targets --all-features --workspace ${{ matrix.minimal-versions && '--exclude adbc_datafusion' || '' }}
130145
# env:
131146
# ADBC_SNOWFLAKE_TESTS: 1
132147
# ADBC_SNOWFLAKE_URI: ${{ secrets.SNOWFLAKE_URI }}
133148
# ADBC_SNOWFLAKE_SQL_DB: ADBC_TESTING
134149
- name: Doctests
135150
working-directory: rust
136151
run: |
137-
cargo test --workspace --doc --all-features
152+
cargo test --doc --all-features --workspace ${{ matrix.minimal-versions && '--exclude adbc_datafusion' || '' }}
138153
- name: Check docs
139154
working-directory: rust
140155
run: |
141-
cargo doc --workspace --all-features
156+
cargo doc --all-features --workspace ${{ matrix.minimal-versions && '--exclude adbc_datafusion' || '' }}
142157
- name: Verify MSRV (Minimum Supported Rust Version)
143-
if: matrix.os == 'ubuntu-latest'
158+
if: matrix.os == 'ubuntu-latest' && ! matrix.minimal-versions
144159
working-directory: rust
145160
run: |
146161
# Install cargo-msrv

rust/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ categories = ["database"]
3535

3636
[workspace.dependencies]
3737
adbc_core = { path = "./core", version = "0.19.0" }
38-
arrow-array = { version = "55.1.0", default-features = false, features = [
38+
arrow-array = { version = ">=53.1.0, <56", default-features = false, features = [
3939
"ffi",
4040
] }
41-
arrow-buffer = { version = "55.0.0", default-features = false }
42-
arrow-schema = { version = "55.0.0", default-features = false }
43-
arrow-select = { version = "55.1.0", default-features = false }
41+
arrow-buffer = { version = ">=53.1.0, <56", default-features = false }
42+
arrow-schema = { version = ">=53.1.0, <56", default-features = false }
43+
arrow-select = { version = ">=53.1.0, <56", default-features = false }

rust/driver/datafusion/Cargo.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,16 +32,16 @@ categories.workspace = true
3232

3333
[dependencies]
3434
adbc_core.workspace = true
35-
arrow-array.workspace = true
36-
arrow-buffer.workspace = true
37-
arrow-schema.workspace = true
35+
arrow-array = "55.0.0"
36+
arrow-buffer = "55.0.0"
37+
arrow-schema = "55.0.0"
3838
datafusion = "47.0.0"
3939
datafusion-substrait = "47.0.0"
4040
tokio = { version = "1.45", features = ["rt-multi-thread"] }
4141
prost = "0.13.5"
4242

4343
[dev-dependencies]
44-
arrow-select.workspace = true
44+
arrow-select = "55.0.0"
4545

4646
[lib]
4747
crate-type = ["lib", "cdylib"]

0 commit comments

Comments
 (0)