Repository navigation
[SPARK-62498][CONNECT][PYTHON] Delegate standard LDA operations to Rust - #1003
Closed
zhengruifeng wants to merge 1 commit into
Closed
zhengruifeng wants to merge 1 commit into
zhengruifeng wants to merge 1 commit into
Conversation
Co-authored-by: Isaac <no-reply@databricks.com>
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?
Delegate standard
pyspark.ml.clustering.LDAto the existing Rust ML API. Python setters synchronize parameters eagerly. The standard and compatibility imports expose the same estimator and model classes.The online optimizer returns a
LocalLDAModel. EM returns aDistributedLDAModel, whosetoLocal()caches the converted model. Both concrete classes now accept a PySparkRemoteModelRefthrough the shared model constructor. When Rust receives a model from the server, it binds the reference after the Python constructor finishes. This preserves the reference across copies and lazy transforms.Why are the changes needed?
The standard estimator previously built fit, transform and persistence requests in Python. Delegating these operations lets standard PySpark LDA tests exercise the implementation used by Rust callers and follows the other migrated clustering estimators. SPARK-62498
Does this PR introduce any user-facing change?
The public imports, class hierarchy and method signatures match PySpark 4.3.0. Existing LDA estimators and models saved by either client can be loaded by the other. The change adds no Python dependencies.
How was this patch tested?
toLocal(), save/load and a lazy transform collected after releasing the model.wasm-udfand ran formatting, Clippy, Ruff, generated-stub and vendor-drift checks.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.