bearomorphism opened a new pull request, #59395: URL: https://github.com/apache/spark/pull/59395
### What changes were proposed in this pull request? Keep `message` local while adding the optional reason prefix in `SparkConnectGrpcException.__init__`, and let the base constructor initialize `_message`. Remove the premature member assignment and its type ignore. ### Why are the changes needed? The input message may be `None`, while `_message` is a string. The base constructor already resolves a missing message from the error class and parameters, so assigning the optional input to the member first is unnecessary. ### Does this PR introduce _any_ user-facing change? No. ### How was this patch tested? - All 12 tests in `pyspark.errors.tests.test_connect_errors_conversion` passed. - Six constructor cases produced identical baseline/modified output, including absent/empty messages and reasons, error-class-based messages, and displayed server stacktraces. - Mypy on `python/pyspark/errors/exceptions/connect.py`, Ruff lint/format checks, and `git diff --check` passed. No new tests were added; validation used the existing suite and local equivalence probes. ### Was this patch authored or co-authored using generative AI tooling? Generated-by: pi 1.1.0 -- 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]
