Repository navigation
[SPARK-62507][CONNECT][PYTHON] Delegate standard term frequency and IDF feature stages to Rust - #1011
Open
zhengruifeng wants to merge 1 commit into
Open
zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
…DF feature stages to Rust Co-authored-by: Isaac <no-reply@databricks.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changes were proposed in this pull request?
Route standard
pyspark.ml.feature.HashingTF,CountVectorizer,CountVectorizerModel,IDFandIDFModelthrough the existing Rust ML bindings. Python setters update the native parameters immediately. Rust handles fitting, transformation, model properties, and persistence. Both client APIs now use the same Spark Connect helper to create a model from a supplied vocabulary.The native feature estimator fit path honors Python subclasses'
_create_modeland_copyValueshooks. A fit or estimator write uses the JVM operator class selected by the Python wrapper. The shared writer also handles PySpark’s special case forPowerIterationClustering, which Spark persists throughPowerIterationClusteringWrapper.Why are the changes needed?
These standard Python imports previously constructed ML requests in Python. Reusing the Rust implementation lets the upstream PySpark feature and pipeline suites exercise the same operations used by Rust applications. SPARK-62507
Does this PR introduce any user-facing change?
The standard and compatibility imports now expose the same classes. Public members and signatures match the official PySpark 4.3.0 client.
HashingTF.indexOfstill requires classic PySpark. This also restoresPowerIterationClustering.save, which failed on master because Spark rejects its unwrapped JVM class name.How was this patch tested?
wasm-udfand checked Clippy, formatting, Ruff, generated stubs and vendored source.Was this patch authored or co-authored using generative AI tooling?
Generated-by: OpenAI Codex (GPT-6)
This pull request and its description were written by Isaac.