-
Notifications
You must be signed in to change notification settings - Fork 28.7k
[SPARK-45093][CONNECT][PYTHON] Properly support error handling and conversion for AddArtifactHandler #44092
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
|
@hvanhovell @HyukjinKwon PTAL |
|
cc @juliuszsompolski @cdkrot @heyihong mind taking a look please? |
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
...er/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala
Outdated
Show resolved
Hide resolved
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/utils/ErrorUtils.scala
Outdated
Show resolved
Hide resolved
| val partial: PartialFunction[Throwable, Throwable] = { | ||
| case e: Throwable if e.isInstanceOf[SparkThrowable] || NonFatal.apply(e) => | ||
| StatusProto.toStatusRuntimeException(buildStatusFromThrowable(e, sessionHolderOpt)) | ||
| case e: StatusRuntimeException => e |
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 case is not present in the query handleError, why it's a case needed here?
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.
In the original query error case, I was very certain that the error conversion does not happen inside the try block. Let me research why I added this (or if I was just cautious)
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/utils/ErrorUtils.scala
Outdated
Show resolved
Hide resolved
connector/connect/server/src/main/scala/org/apache/spark/sql/connect/utils/ErrorUtils.scala
Show resolved
Hide resolved
...er/src/main/scala/org/apache/spark/sql/connect/service/SparkConnectAddArtifactsHandler.scala
Outdated
Show resolved
Hide resolved
|
Merged to master. |
…nversion for AddArtifactHandler ### What changes were proposed in this pull request? This patch improves the error handling when errors are happening in the `AddArtifact` path. In particular, the `AddArtifactHandler` would not properly return exceptions but all exceptions would end up yielding `UNKNOWN` errors. This patch makes sure we wrap the errors in the add artifact path the same way as we're wrapping the errors in the normal query execution path. In addition, it adds tests and verification for this behavior in Scala and in Python. ### Why are the changes needed? Stability ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added UT for Scala and Python ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#44092 from grundprinzip/SPARK-ADD_ARTIFACT_CRAP. Authored-by: Martin Grund <martin.grund@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
…nversion for AddArtifactHandler ### What changes were proposed in this pull request? This patch improves the error handling when errors are happening in the `AddArtifact` path. In particular, the `AddArtifactHandler` would not properly return exceptions but all exceptions would end up yielding `UNKNOWN` errors. This patch makes sure we wrap the errors in the add artifact path the same way as we're wrapping the errors in the normal query execution path. In addition, it adds tests and verification for this behavior in Scala and in Python. ### Why are the changes needed? Stability ### Does this PR introduce _any_ user-facing change? No ### How was this patch tested? Added UT for Scala and Python ### Was this patch authored or co-authored using generative AI tooling? No Closes apache#44092 from grundprinzip/SPARK-ADD_ARTIFACT_CRAP. Authored-by: Martin Grund <martin.grund@databricks.com> Signed-off-by: Hyukjin Kwon <gurwls223@apache.org>
What changes were proposed in this pull request?
This patch improves the error handling when errors are happening in the
AddArtifactpath. In particular, theAddArtifactHandlerwould not properly return exceptions but all exceptions would end up yieldingUNKNOWNerrors. This patch makes sure we wrap the errors in the add artifact path the same way as we're wrapping the errors in the normal query execution path.In addition, it adds tests and verification for this behavior in Scala and in Python.
Why are the changes needed?
Stability
Does this PR introduce any user-facing change?
No
How was this patch tested?
Added UT for Scala and Python
Was this patch authored or co-authored using generative AI tooling?
No