-
Notifications
You must be signed in to change notification settings - Fork 29k
[SPARK-45808][CONNECT][PYTHON] Better error handling for SQL Exceptions #43667
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
juliuszsompolski
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with nits
HyukjinKwon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
amazing, LGTM
@itholic mind double checking?
|
Oh let's also file a JIRA btw |
|
Filed SPARK-45808 |
| ErrorUtils.throwableToFetchErrorDetailsResponse( | ||
| st = error, | ||
| serverStackTraceEnabled = sessionHolder.session.conf.get( | ||
| Connect.CONNECT_SERVER_STACKTRACE_ENABLED) || sessionHolder.session.conf.get( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are we deprecating this config Connect.CONNECT_SERVER_STACKTRACE_ENABLED?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's still used, but only verifies the display behavior rather than the stack trace generation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we also make Connect.CONNECT_SERVER_STACKTRACE_ENABLED work for Scala client in this pr?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a bit more weird, in contrast to Python, the server backtrace is always there in Scala, but the user can decide how to print it.
|
Merged to master. |
|
Late LGTM. This is cool. Thanks! |
### What changes were proposed in this pull request? Revert #44144, and introduce a forbid recursion guard as previously proposed. This way the infinite error handling recursion is still prevented, but the client-side knob is still present. ### Why are the changes needed? Previously proposed as part of #44144, however was discussed in favour of something else. However it seems (proposal by grundprinzip) that the original proposal was more correct, since it seems driver stacktrace is decided on client not server (see #43667) ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Hand testing ### Was this patch authored or co-authored using generative AI tooling? No Closes #44210 from cdkrot/forbid_recursive_error_handling_2. Authored-by: Alice Sayutina <[email protected]> Signed-off-by: Hyukjin Kwon <[email protected]>
What changes were proposed in this pull request?
This patch optimizes the handling of errors reported back to Python. First, it properly allows the extraction of the
ERROR_CLASSand theSQL_STATEand gives simpler accces to the stack trace.It therefore makes sure that the display of the stack trace is no longer only server-side decided but becomes a local usability property.
In addition the following methods on the
SparkConnectGrpcExceptionbecome actually useful:getSqlState()getErrorClass()getStackTrace()Why are the changes needed?
Compatibility
Does this PR introduce any user-facing change?
No
How was this patch tested?
Updated the existing tests.
Was this patch authored or co-authored using generative AI tooling?
No