HyukjinKwon opened a new pull request, #732:
URL: https://github.com/apache/spark-connect-rust/pull/732

   ### What changes were proposed in this pull request?
   
   A review of the last 50 commits found that the replay tests of the 
classification goldens didn't compare what they claimed to 
(`crates/spark-connect/tests/common/ml_golden.rs` and the golden tests). This 
PR makes them compare it. Tests only; no product code changes.
   
   - **A relation entry from a command.** A classification transform 
(`MlRelation.Transform`, field 1) decodes as an `MlCommand.Fit` (also field 1), 
so the transform entries were registered as bogus Fit exchanges. One test, 
`every_golden_command_of_the_classification_goldens_is_an_ml_command`, passed 
vacuously because of it. An entry is now a relation by its recorded value, a 
DataFrame, and relations decode as `MlRelation`.
   - **Deletes and every command of a call.** The replay now records Deletes, 
so a test can assert them. `Checker` now fails on requests of an earlier call 
that nothing checked. That found unchecked loads of NB, MLP and FM, and the 
second evaluate of the MLP and FM summaries, which are now checked.
   - **Uids.** A golden command with a raw random uid is refused, and the 
comments now say what a uid placeholder checks.
   - **Fits.** The `fits` entries of DecisionTree, GBT, RandomForest (binary 
and multiclass) and OneVsRest's per-class fit are replayed through a fit with 
the golden params.
   - **Persistence.** The unused persistence entries are now checked:
     - RandomForest multiclass's estimator load passes.
     - The rest are in an `#[ignore]`d known-gaps test, whose doc comment gives 
each cause:
       - the NaiveBayes, MLP and FM estimators have no typed load in the Rust 
API, a product gap fixed in a follow-up;
       - the OneVsRest loads read metadata through a DataFrame query, as 
PySpark's `DefaultParamsReader.loadMetadata` does, which the golden doesn't 
record (a limit of the replay);
       - the forest model's load fetches its trees lazily.
   - **Datasets.** The replayed fits of NB, LR, LinearSVC, MLP, FM and the 
trees now train on the golden rows, and their datasets' rows are checked 
against them.
   - **Transforms.**
     - Offline, the transform relations of the persisted NB, MLP, FM, 
LogisticRegression and LinearSVC models are compared (operator and params).
     - Live, the Naive Bayes transforms are compared with PySpark's rows.
   
   Still uncompared, as the comments say: the inputs of evaluate, summary and 
transform, most model-entry transforms, and the live transform rows of families 
other than Naive Bayes.
   
   ### Why are the changes needed?
   
   Several of these tests could not fail. Each check here was mutated to show 
that it now fails, and that it passes on the real golden. For example, NB's 
transform compared against LinearSVC's entry, a fit dataset swapped for 
`range(3)`, the delete recording disabled, and an unchecked MLP load.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, tests only.
   
   ### How was this patch tested?
   
   - `cargo test -p apache-spark-connect --release --no-fail-fast` (offline): 
1258 passed, 0 failed, 27 ignored (the known-gaps test among them; it fails 
with `--ignored`, as designed).
   - `e2e_classification_misc_api` live against a Spark 4.3.0 Connect server: 
11 passed.
   - `cargo fmt --check`, `cargo +1.100.0 clippy --workspace --all-targets -- 
-D warnings` and `scripts/audit_no_stubs.sh` are clean.
   
   ### 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]

Reply via email to