HyukjinKwon opened a new pull request, #774:
URL: https://github.com/apache/spark-connect-rust/pull/774
### What changes were proposed in this pull request?
A review of the last 100 commits found tests, CI steps and docs that those
commits left stale, vacuous or unrun. This PR fixes them. Apart from test code,
it changes CI and docs only.
**Stale and vacuous tests**
- `classification_misc_api_golden.rs`: the known-gaps test still said
NaiveBayes, MLP and FM have no typed estimator load, which #734 added. Their
six persistence entries now replay through `NaiveBayes::load`,
`MultilayerPerceptronClassifier::load` and `FMClassifier::load`, with their
params compared by value, and `load_estimator_stage` is gone. The `#[ignore]`d
test keeps only its two real causes, and is now
`one_vs_rest_and_forest_model_loads_as_official_pyspark`.
- `dataframe_extra_golden.rs` is deleted. Its 12 ignored tests had empty
bodies, and its existence check opened a golden that exists nowhere and passed
anyway. 8 of its cases are byte-compared already in `plans_golden.rs`.
- `feature_models_replay.rs` now compares the Delete of
QuantileDiscretizer's temporary model with the golden (`assert_deletes`). Since
#732 the replay records deletes, and the comment saying otherwise is fixed.
**Tests that claimed the official client runs them**
- A fresh-import check of `test_ml_api_offline.py` fell back to
`pyspark.ml.classification` on any `ImportError`, so it passed on the vendored
classes when the native module failed to import. It now uses the rule of #673,
through a new `native_module()` of `_native_classes.py`: the reference only
when `pyspark._pyspark` is absent.
- `test_ml_subclasses_offline.py` said official PySpark runs it, but 5 of
its 19 tests failed there. The native-only ones skip on the reference: 15 pass
and 4 skip.
- `test_evaluation_api_offline.py` could not even be collected there, since
`test_ml_offline.py` imports `pyspark._pyspark` at module level. Now 12 pass
and 1 skips.
**Tests that no workflow ran**
- `to_expression_takes_any_columns_as_a_vec_does` (`wasm_udf.rs`) runs the
packer. It is in `rust.yml`'s ignored-packer filter now, and its iterator case
really iterates.
- The 9 unit tests of `pyspark-rs` run in a new `pyspark-rs-unit` job of
`rust.yml`. pyo3's `extension-module` leaves the Python symbols undefined, so
the job links libpython for them.
- The protobuf-free job of `build_python_connect.yml` installs
`plotly<6.0.0`, so the plot check of
`test_pandas_api_takes_its_index_and_plot_is_of_pyspark` runs instead of
skipping. It also reports skips with `-rs`, as `coverage.yml` does.
**Guards**
- `coverage.yml` checks that every `test_*_offline.py` and
`test_arrow_handoff.py` is in its offline list. It is the only workflow that
runs them, so before, a new file nobody added would run nowhere.
- The Rust guard of `build_python_connect.yml` covered `e2e_*.rs` only. It
now covers every test file that reads `SPARK_REMOTE` or opens a live session:
`array_literal`, `arrow_map_input`, `execute_plan_hook`, `raw_relation`,
`types_roundtrip`, and the core's `integration_test`. Each already ran live,
and now cannot silently stop.
**Helpers and the mock server**
- Every replay helper and `e2e_evaluators.rs` use `ml_golden::assert_error`,
which refuses an empty golden message, as #727 made it, now checked after
stripping the `(java.X) ` prefix. `test_evaluators_e2e.py` checks the same.
- The mock server's `retry_info_failures`, `execute_gate_timeouts`,
`result_complete_operations`, `plan_compression_lookups` and the
release-session gate no longer serve a forgotten session's late request, as
#717 did for the execute queue.
**Test coverage**
- `test_ml_regression_clustering_classes_e2e.py` gets the checks that #726
added to the feature and fpm class tests: a copy with extra params, a fit of
one param map, and `read().load`.
- The "needs protobuf >= 6.33.5" guards of three offline files that no
longer use protobuf (since #765) are removed.
**CI and docs**
- `lint.yml` adds the `wasm32-wasip1` target and lints `tests/wasm-udf-wasi`
(#529 added the crate to the test jobs only).
- The 7 download steps of #766 use `${SPARK_VERSION}` instead of 14
hardcoded `spark-4.3.0-bin-hadoop3`. Bumping `SPARK_VERSION` alone left
`SPARK_HOME` empty there.
- Docs updated:
- `dev/design/ci.md`: the downloads from the CDN, the offline gate's 25
files, the guards, the protobuf-free job, the core's live test step,
wasm-udf-wasi;
- `dev/design/official-tests.md`, `test-harness.md`,
`docs/contributing.md`, `docs/architecture.md` (the two published crates of
#764) and `AGENTS.md`;
- the version claim of `docs/compatibility.md` and `docs/index.md`, which
is false on master (4.4.0 speaking 4.3.0).
### Why are the changes needed?
Tests that pass vacuously, or that no workflow runs, hide regressions.
Several of these were found to hide real behavior in the review, and the CI
guards now keep test files from silently dropping out.
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
- `cargo test -p apache-spark-connect --release` offline, and the changed
replay and golden tests. With `SPARK_REMOTE` against a Spark 4.3.0 server: 137
passed across 13 binaries.
- `--features wasm-udf --no-run`.
- `cargo fmt --all --check`, and `cargo +1.100.0 clippy -p
apache-spark-connect -p pyspark-rs --all-targets`.
- The offline suite of `coverage.yml`, `test_dropin_e2e.py` and
`test_arrow_e2e.py` live, and the changed offline files: 1322 passed.
- `test_ml_subclasses_offline.py` and `test_evaluation_api_offline.py` on
official PySpark 4.3.0.
- Mutations: both guards catch a missing file, a mention in a comment isn't
flagged, and the new helper and mock cases fail on master's code.
- Every workflow parses, and the changed shell steps were dry-run, including
all 7 download steps with `SPARK_VERSION=4.4.0`.
- ruff 0.14.0, `audit_no_stubs.sh`, `scripts/tests` and
`test_ruff_excludes.py`.
### Was this patch authored or co-authored using generative AI tooling?
Generated-by: Claude Opus 5.5
This pull request and its description were written by Isaac.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]