Skip to content

Commit eec2dff

Browse files
authored
ci: Check datafusion-spark feature combinations to catch publish errors (apache#24475)
## Which issue does this PR close? - Closes apache#24474 ## Rationale for this change Publishing `datafusion-spark` 55.0.0 failed with ``` error[E0433]: cannot find module or crate `datafusion` in this scope --> src/function/string/quote.rs:20:5 ``` because the library referenced the optional `datafusion` dependency (only enabled by the `core` feature) from code that is not gated on that feature. CI did not catch this workspace-wide builds always compile `datafusion-spark` with the optional `datafusion` dependency present due to feature unification. The underlying import error was already fixed on `main` in apache#24351, so this PR adds the missing CI coverage to prevent the problem from reoccurring. ## What changes are included in this PR? Add a `cargo check datafusion-spark features` CI job, following the pattern of the existing per-crate feature check jobs (e.g. `datafusion-functions`), that checks the crate standalone. Also add the new job to the required status checks in `.asf.yaml`, like the other per-crate feature check jobs. ## Are these changes tested? Yes, by CI itself (the new job runs on this PR). ## Are there any user-facing changes? No, CI only.
1 parent 309dad8 commit eec2dff

2 files changed

Lines changed: 28 additions & 0 deletions

File tree

‎.asf.yaml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ github:
6666
- "cargo check datafusion-proto features"
6767
- "cargo check datafusion features"
6868
- "cargo check datafusion-functions features"
69+
- "cargo check datafusion-spark features"
6970
- "cargo test (amd64)"
7071
- "cargo test datafusion-cli (amd64)"
7172
- "cargo examples (amd64)"

‎.github/workflows/rust.yml‎

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,33 @@ jobs:
287287
- name: Check datafusion-functions (unicode_expressions)
288288
run: cargo check --profile ci --no-default-features -p datafusion-functions --features=unicode_expressions
289289

290+
# Check datafusion-spark crate features
291+
#
292+
# Ensure via `cargo check` that the crate can be built with a
293+
# subset of the features packages enabled.
294+
# See https://github.com/apache/datafusion/issues/24474
295+
linux-cargo-check-datafusion-spark:
296+
name: cargo check datafusion-spark features
297+
needs: linux-build-lib
298+
runs-on: ubuntu-latest
299+
container:
300+
image: amd64/rust
301+
steps:
302+
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
303+
- name: Setup Rust toolchain
304+
uses: ./.github/actions/setup-builder
305+
with:
306+
rust-version: stable
307+
- name: Check datafusion-spark (default features)
308+
run: cargo check --profile ci --all-targets -p datafusion-spark
309+
#
310+
# Note: Only check libraries (not --all-targets) to cover end user APIs
311+
#
312+
- name: Check datafusion-spark (no-default-features)
313+
run: cargo check --profile ci --no-default-features -p datafusion-spark
314+
- name: Check datafusion-spark (core)
315+
run: cargo check --profile ci --no-default-features -p datafusion-spark --features=core
316+
290317
# Library and integration tests
291318
linux-test:
292319
name: cargo test (amd64)

0 commit comments

Comments
 (0)