HyukjinKwon opened a new pull request, #197: URL: https://github.com/apache/spark-connect-rust/pull/197
### What changes were proposed in this pull request? [SPARK-60961](https://issues.apache.org/jira/browse/SPARK-60961): a gRPC error that carries no error of the server now raises `SparkConnectGrpcException` of its status code, which `getGrpcStatusCode()` returns, as PySpark's `_handle_rpc_error` raises it. Examples are an `UNAVAILABLE` of an unreachable server once the retries are exhausted, an `UNAUTHENTICATED` or `PERMISSION_DENIED` of a proxy, and a `RESOURCE_EXHAUSTED`. The message is the transport's, which names the status and gives its message. The mock Connect server of the tests can now fail an `ExecutePlan` with any status code. ### Why are the changes needed? These errors raised `PySparkRuntimeError`, which is not a `SparkConnectGrpcException`. So `except SparkConnectGrpcException` no longer caught them, as it did while that class was an alias, and they had no status code. ### Does this PR introduce _any_ user-facing change? Yes, these errors raise the exception of PySpark 4.3.0. ### How was this patch tested? - Against a mock Connect server, an `ExecutePlan` failing with `INVALID_ARGUMENT`, `PERMISSION_DENIED`, `UNAUTHENTICATED`, `RESOURCE_EXHAUSTED` or `INTERNAL`, and an `AnalyzePlan` failing with `INVALID_ARGUMENT`, raise the same exception class and status code as in official PySpark 4.3.0, with the operation id of the request. Before this change, all of them differed. A `DEADLINE_EXCEEDED` of an execution's stream differs: PySpark 4.3.0 reattaches it under its per-RPC deadlines, which [SPARK-60997](https://issues.apache.org/jira/browse/SPARK-60997) tracks. - New offline tests check these cases. They fail without this change. - The lib tests and every integration test, e2e included, against a local Spark 4.3.0 server (648 passed, and 123 of the transport crate), the build of all tests with `wasm-udf`, the offline Python suites (726 passed, 9 skipped), and the live drop-in and Arrow suites (76 passed) and live cases (10 passed). Clippy reports no diagnostics in the changed lines. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: Claude Opus 5.5 This pull request and its description were written by Isaac. -- 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]
