HyukjinKwon opened a new pull request, #661: URL: https://github.com/apache/spark-connect-rust/pull/661
### What changes were proposed in this pull request? This adds a rule to the "Architectural constraints" section of `AGENTS.md`: the native ML classes follow `pyspark.ml`, not the deprecated `pyspark.ml.connect`. The Rust-backed estimators, models, transformers and evaluators that the drop-in exports from `pyspark.ml.connect` took PySpark's deprecated `pyspark.ml.connect` module as their reference in several places. That module is pandas and PyTorch based, and has been deprecated since Spark 4.0. The ML owner pointed it out on #634, and SPARK-61629, SPARK-61630, SPARK-61624 and SPARK-61642 moved the native classes to the standard `pyspark.ml` API over Spark Connect. The rule says what that means, where agents and contributors read it: - Datasets: `fit`, `transform` and `evaluate` take Spark DataFrames only. A pandas DataFrame raises `reject_pandas`'s `TypeError`, another object `sparkSession`'s `AttributeError`, and the helper calls raise what `pyspark.ml`'s literal serialization raises. - Features: a features column must be a `VectorUDT` column, with no implicit `array_to_vector`. - Columns: column params are sent as given, with no client-side respelling or casting. - Params: every class has `pyspark.ml`'s keyword-only `setParams` (`set_params_of`), and its `fit`, `transform` or `evaluate` takes `params=None` (`check_fit_params`, `check_params`). A new class goes into `_NATIVE_PARAMS` (or the feature stages' golden `api`), whose tests check its setters, `setParams` and `params` against PySpark's. - Vendored modules: the vendored `pyspark.ml.connect` modules stay byte-identical to PySpark's. ### Why are the changes needed? New native classes keep landing. Without a written rule, they can take the deprecated module as their reference again, or lack `setParams` and `params`; that happened several times this week. ### Does this PR introduce _any_ user-facing change? No. Documentation for contributors only. ### How was this patch tested? I checked each statement against master at 2c3bbd97, where #643 (SPARK-61630) landed: `dataset_of`, `helper_dataset_of`, `reject_pandas`, `set_params_of`, `check_fit_params`, `check_params` and the `_NATIVE_PARAMS` tests. ### 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]
