ci: run Python client tests against a cluster built from the branch - #2374
Draft
andygrove wants to merge 2 commits into
Draft
ci: run Python client tests against a cluster built from the branch#2374andygrove wants to merge 2 commits into
andygrove wants to merge 2 commits into
Conversation
The existing "Python Release Build" job cannot catch Rust regressions. Its tests call setup_test_cluster(), which starts the scheduler and executor in-process from the crates.io release that python/Cargo.toml pins, so the code under review is never loaded. It also only triggers on python/** changes. Add a workflow that keeps the client on that pinned release and swaps the cluster for one built from the branch, which is the combination users actually run between releases. Trigger it on ballista/** too. Add BALLISTA_TEST_SCHEDULER to setup_test_cluster() so the existing tests can be pointed at an already-running scheduler, and add a test whose query crosses a shuffle boundary so intermediate shuffle write and read are covered rather than just the final stage fetch.
andygrove
marked this pull request as ready for review
August 25, 2026 22:09
andygrove
marked this pull request as draft
August 26, 2026 15:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Which issue does this PR close?
Closes #2372.
Rationale for this change
The Python client is effectively untested against the code we change. There is a pytest job, but two things stop it covering Rust changes:
.github/workflows/build.yml("Python Release Build") triggers onpull_requestwithpaths: ["python/**"]. Any PR touchingballista/core,ballista/schedulerorballista/executorskips it.setup_test_cluster(), which starts the scheduler and executor in-process from the crates.io release thatpython/Cargo.tomlpins. The code under review is never loaded.Note that simply adding
ballista/**to the existing job's path filter fixes neither problem. It would spend CI minutes and still test the released crates against themselves.This is not hypothetical. #2367 is a report of a query failing with
Failed to open partition file at ".../data.arrow": NotFoundafter the job reported Completed, and it comes down to a client and a cluster disagreeing about shuffle file naming. Building this workflow reproduced it on the first run.The client cannot be moved forward to close the gap.
pyballistare-exports datafusion-python types (datafusion_python::dataframe::PyDataFrameand friends inpython/src/lib.rs), sodatafusion-python,datafusionandballista-coremust all link the samedatafusion. The workspace is on the55.0.0-rc3git tag while crates.iodatafusion-pythonis still at54.0.0, so the bindings cannot move until there is a matching datafusion-python release. In practice the Python client normally lags the cluster by a DataFusion release cycle, which means client/cluster skew is the steady state for Python users rather than an edge case, and it is worth testing on purpose.So this PR keeps the client on the pinned release and swaps the cluster for one built from the branch.
What changes are included in this PR?
.github/workflows/python-integration.yml(new). Buildsballista-schedulerandballista-executorfrom the working tree, starts them, and runs the existing pytest suite against them with the client built the same way the release job builds it. Triggers onballista/**as well aspython/**.A few details worth calling out for review:
build.yml, because that workflow's path filter also gates the Mac, Windows and manylinux wheel jobs. Widening it there would build wheels on every Rust PR.python/so the relative paths the tests register (testdata/test.parquetand friends) resolve executor-side as well as client-side.python/python/ballista/__init__.py.setup_test_cluster()now honoursBALLISTA_TEST_SCHEDULER=host:portand returns that instead of starting an in-process cluster. Wrapping it here rather than in the tests means all six call sites across the three test files pick it up unchanged, and so will any test added later.python/python/tests/test_context.py. Addstest_multi_stage_query. Every existing test is single-stage. Those still round-trip the final stage's shuffle output through Arrow Flight, but only a repartitioning query also exercises the intermediate shuffle write and read between executors. Confirmed in the executor log that this query runs stages 1, 2 and 3 while the others run stage 1 only.Are there any user-facing changes?
No.
setup_test_cluster()is a test helper and its default behaviour is unchanged. The new environment variable is opt-in.One thing for reviewers to weigh: this job deliberately runs an older client against a current cluster. If #2370 lands and starts refusing mismatched clients at connect time, this job goes red by design and the two need to be reconciled. I have left a note on that issue.