Skip to content

Commit 614659b

Browse files
committed
[SPARK-31849][PYTHON][SQL][FOLLOW-UP] More correct error message in Python UDF exception message
### What changes were proposed in this pull request? This PR proposes to fix wordings in the Python UDF exception error message from: From: > An exception was thrown from Python worker in the executor. The below is the Python worker stacktrace. To: > An exception was thrown from the Python worker. Please see the stack trace below. It removes "executor" because Python worker is technically a separate process, and remove the duplicated wording "Python worker" . ### Why are the changes needed? To give users better exception messages. ### Does this PR introduce _any_ user-facing change? No, it's in unreleased branches only. If RC3 passes, yes, it will change the exception message. ### How was this patch tested? Manually tested. Closes #28762 from HyukjinKwon/SPARK-31849-followup-2. Authored-by: HyukjinKwon <[email protected]> Signed-off-by: HyukjinKwon <[email protected]> (cherry picked from commit e289140) Signed-off-by: HyukjinKwon <[email protected]>
1 parent bd0f5f2 commit 614659b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/pyspark/sql/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,8 +116,8 @@ def convert_exception(e):
116116
# To make sure this only catches Python UDFs.
117117
and any(map(lambda v: "org.apache.spark.sql.execution.python" in v.toString(),
118118
c.getStackTrace()))):
119-
msg = ("\n An exception was thrown from Python worker in the executor. "
120-
"The below is the Python worker stacktrace.\n%s" % c.getMessage())
119+
msg = ("\n An exception was thrown from the Python worker. "
120+
"Please see the stack trace below.\n%s" % c.getMessage())
121121
return PythonException(msg, stacktrace)
122122
return UnknownException(s, stacktrace, c)
123123

0 commit comments

Comments
 (0)