uros-b opened a new pull request, #57786: URL: https://github.com/apache/spark/pull/57786
### What changes were proposed in this pull request? Extracts a private helper `throwInvalidExternalValue(value, dataType): Nothing` in `CatalystTypeConverters` and routes the eight byte-identical `INVALID_EXTERNAL_VALUE` throw sites through it. ### Why are the changes needed? The eight throw blocks were identical apart from the trailing `dataType` argument, so the same six lines were repeated eight times. Factoring them into one helper removes about 31 lines of duplication with no behavior change: the same error class and the same three message parameters (`other`, `otherClass`, `dataType`) are produced, and the `Nothing` return type keeps every match arm's result type unchanged. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? Behavior-preserving refactor. Existing conversion tests, which assert the error condition and its parameters via `checkError`, cover these paths. No new tests needed. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Code (Opus 4.8) -- 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]
