advancedxy commented on a change in pull request #25814: [SPARK-19926][PYSPARK]
make captured exception from JVM side user friendly
URL: https://github.com/apache/spark/pull/25814#discussion_r325673269
##########
File path: python/pyspark/sql/utils.py
##########
@@ -25,7 +25,12 @@ def __init__(self, desc, stackTrace, cause=None):
self.cause = convert_exception(cause) if cause is not None else None
def __str__(self):
- return repr(self.desc)
+ desc = self.desc
+ # encode unicode instance for python2 for human readable description
+ if sys.version_info.major < 3 and isinstance(desc, unicode):
+ return str(desc.encode('utf-8'))
Review comment:
OK.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]