zhengruifeng opened a new pull request, #60194: URL: https://github.com/apache/spark/pull/60194
### What changes were proposed in this pull request? Accept `intermediateStorageLevel` as a keyword in PySpark KMeans's `__init__` and `setParams`, and update their documented signatures. This follows up #56949. ### Why are the changes needed? Although KMeans exposes this shared parameter and its setter, `KMeans(intermediateStorageLevel="DISK_ONLY")` and `KMeans().setParams(intermediateStorageLevel="DISK_ONLY")` currently raise `TypeError`. ### Does this PR introduce _any_ user-facing change? Yes. Users can configure the intermediate storage level through constructor and `setParams` keyword arguments. The default remains `MEMORY_AND_DISK`. ### How was this patch tested? - Extended the existing KMeans test to check the default, constructor configuration, `setParams` updates, and propagation to the fitted model. - `ClusteringTests.test_kmeans` and Spark Connect's `ClusteringParityTests.test_kmeans` both passed, using an existing Hive-enabled assembly with identical KMeans JVM sources. - Python lint and formatting checks passed. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-6) -- 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]
