Skip to content

Commit f2c884f

Browse files
committed
Add a comment to explain the workaround
1 parent 2d3c321 commit f2c884f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

python/pyspark/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ def _exception_message(excp):
3535
True
3636
"""
3737
if isinstance(excp, Py4JJavaError):
38+
# 'Py4JJavaError' doesn't contain the stack trace available on the Java side in 'message'
39+
# attribute in Python 2. We should call 'str' function on this exception in general but
40+
# 'Py4JJavaError' has an issue about addressing non-ascii strings. So, here we work
41+
# around by the direct call, '__str__()'. Please see SPARK-23517.
3842
return excp.__str__()
3943
if hasattr(excp, "message"):
4044
return excp.message

0 commit comments

Comments
 (0)