HyukjinKwon opened a new pull request, #691:
URL: https://github.com/apache/spark-connect-rust/pull/691
### What changes were proposed in this pull request?
Three fixes of the PyO3 base of the native ML classes (#681), which the area
PRs found:
- **`params_only` of `native_pymethods!`**: it was an optional section
before the body of any tokens, which Rust's macros cannot parse ("local
ambiguity when calling macro `native_pymethods`"). The arms with `params_only:
[...];`, a section that is not optional, now come first. The arms without it
forward an empty one. So an estimator can declare the Param attributes of
params whose getters it writes itself (LogisticRegression's `threshold` and
`thresholds`).
- **`model_cases` of `python/tests/_ml_api_cases.py`** takes the DataFrame
of its fit as an argument, instead of a module global that an earlier test's
cases set, so a family that reuses it does not depend on the order of the tests.
- **The fresh-import test** of `test_ml_api_offline.py` runs its interpreter
in a directory without a pyspark, of the path of the tests' process. Of the
tests' cwd (`python/`), the reference run on official PySpark imported the
drop-in instead.
### Why are the changes needed?
The area PRs that convert their classes to the macros need `params_only` and
the shared cases, and the reference run of the API tests on official PySpark
must import official PySpark.
### Does this PR introduce _any_ user-facing change?
No. The changes are to an internal macro and to tests.
### How was this patch tested?
- A probe of `params_only` on LinearSVC (its `threshold` moved from `params`
to `params_only`, with a hand-written getter) compiled. Its class attribute,
instance Param, `params` and getter behaved the same. The probe is not part of
this PR.
- `test_ml_api_offline.py` and `test_ml_api_e2e.py` pass on this branch (28
passed, 5 skipped), and on official pyspark-client 4.3.0 as the reference, the
fresh-import test included.
### 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]