zhengruifeng opened a new pull request, #57839: URL: https://github.com/apache/spark/pull/57839
### What changes were proposed in this pull request? This PR constructs VectorIndexerModel's per-vector transformation function for each `transform` call instead of caching it on the model. The function captures only the state needed for that transformation. It also adds a regression test that changes `handleInvalid` after a transform has been executed. ### Why are the changes needed? The cached function retained transformation-only state on the model and continued using the initial `handleInvalid` value after the parameter changed. Constructing it at transform time releases that state and honors the current parameter value. ### Does this PR introduce _any_ user-facing change? Yes. Updating `handleInvalid` on an existing VectorIndexerModel now takes effect after an earlier transformation. ### How was this patch tested? Added a regression case to `VectorIndexerSuite` and ran: ``` build/sbt -Dsbt.supershell=false 'mllib/testOnly org.apache.spark.ml.feature.VectorIndexerSuite' ``` ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Codex (GPT-5) -- 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]
