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

   ### What changes were proposed in this pull request?
   
   The native ML parity work compares each member of the Rust client with a 
golden captured from official PySpark 4.3.0 (#668, #675). Those tests run live 
against a Spark server. This PR adds an offline replay of the same goldens to 
the shared helper, `crates/spark-connect/tests/common/ml_golden.rs`, so the 
Rust family PRs can also check the requests that each member sends:
   
   - `ReplayServer::start(entries)` serves a loopback Spark Connect service and 
returns a `SparkSession` connected to it. Each ML command is answered with the 
result or error that the golden entries recorded, and each command the client 
sends is recorded.
   - `assert_commands(server, entry, at)` checks the recorded commands of a 
call against the entry's `commands`.
   - `normalize_commands` numbers object ids and uids per entry (`<id0>`, 
`<uid0>`, ...) as the golden does, and clears save paths and datasets. The 
replay compares operators, methods and params, not data.
   - `golden_commands(entry)` decodes an entry's commands.
   
   Deletes of released objects are not in the golden. The replay completes them 
with no result and does not record them. RPCs other than ExecutePlan, Config 
and ReleaseExecute are refused.
   
   `crates/spark-connect/tests/ml_golden_replay.rs` is the self-test. It 
replays a LinearSVC `coefficients` fetch and two training summary members 
(`totalIterations`, `objectiveHistory`), checks that a mismatched command 
fails, and decodes every command of the classification goldens.
   
   ### Why are the changes needed?
   
   Without it, the requests of the native ML members can only be checked 
against a live server. With it, the family PRs (classification, regression, 
clustering, feature) can check every member's request and value offline in CI.
   
   ### Does this PR introduce _any_ user-facing change?
   
   No, test helpers only.
   
   ### How was this patch tested?
   
   - The self-test passes: 3 of 3.
   - The existing tests that use `ml_golden.rs` (`ml_golden_helpers`) still 
pass.
   - `cargo fmt --check` and `cargo +1.100.0 clippy -- -D warnings` 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