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

   ### What changes were proposed in this pull request?
   
   This is a follow-up of #698 (SPARK-61708), found while reviewing the last 50 
commits.
   
   PySpark's `CrossValidator._kFold` and `TrainValidationSplit._fit` split the 
dataset with `F.rand(seed)`. Its literal raises `VALUE_NOT_BETWEEN` for an int 
beyond a long, before any request. On both clients the `seed` param takes such 
an int (`CrossValidator(seed=2**64).getSeed()` returns it). On a fit, though:
   
   | seed | official pyspark-client 4.3.0 | native, before |
   |---|---|---|
   | `2**63`, `-(2**63) - 1`, `2**64` | `PySparkValueError: [VALUE_NOT_BETWEEN] 
Value for `value` must be between -9223372036854775808 and 32767.` | 
`OverflowError: Python int too large to convert to C long` |
   | `2**63 - 1` | fits | fits |
   
   This PR makes the native validators' fit raise the error of the literal, 
through the same function as this client's `F.rand`, before any request.
   
   ### Why are the changes needed?
   
   To match PySpark 4.3.0.
   
   ### Does this PR introduce _any_ user-facing change?
   
   Yes. A CrossValidator or TrainValidationSplit fit with a seed beyond a long 
raises PySpark's `PySparkValueError` instead of an `OverflowError`.
   
   ### How was this patch tested?
   
   - A new offline test, 
`test_ml_connect_validators_of_a_seed_beyond_a_long_raise_value_not_between_as_pyspark`
 in `python/tests/test_ml_offline.py`, covers both validators and three seeds. 
It checks the error class and message, and that no request was sent. It fails 
without the change and passes with it.
   - The CI-order offline suite passes (5670 passed).
   - `cargo fmt --check`, `cargo +1.100.0 clippy --workspace --all-targets -- 
-D warnings`, `scripts/audit_no_stubs.sh`, `ruff check` and `ruff format 
--check` 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