dongjoon-hyun opened a new pull request, #602: URL: https://github.com/apache/spark-connect-swift/pull/602
### What changes were proposed in this pull request? This PR fixes `DataFrameStatFunctions.cov`, `corr`, and `approxQuantile` to throw `SparkConnectError.InvalidType` instead of crashing on an unexpected result. - `collectDouble` (`cov`, `corr`): use `Row.getAsDouble(0)` instead of `as! Double`. - `approxQuantile`: use `as? [[Double]]` with a `throw` instead of nested `as!`. ### Why are the changes needed? `as!` traps the process when the result is `NULL` or has an unexpected type. A thrown error can be caught by callers. ### Does this PR introduce _any_ user-facing change? No for normal usage. An unexpected result now throws `InvalidType` instead of crashing. ### How was this patch tested? Added empty-DataFrame, single-row, and null-value cases to `DataFrameStatFunctionsTests`. `swift build` passes, but the new tests were not run because they need a live Spark Connect server. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Sonnet 5.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]
