You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by GitBox <gi...@apache.org> on 2020/11/11 07:00:20 UTC

[GitHub] [spark] HyukjinKwon commented on a change in pull request #30309: [WIP][SPARK-33407][PYTHON] Simplify the exception message from Python UDFs

HyukjinKwon commented on a change in pull request #30309:
URL: https://github.com/apache/spark/pull/30309#discussion_r521155393



##########
File path: python/pyspark/worker.py
##########
@@ -604,17 +604,19 @@ def process():
         # reuse.
         TaskContext._setTaskContext(None)
         BarrierTaskContext._setTaskContext(None)
-    except BaseException:
+    except BaseException as e:
         try:
-            exc_info = traceback.format_exc()
-            if isinstance(exc_info, bytes):
-                # exc_info may contains other encoding bytes, replace the invalid bytes and convert
-                # it back to utf-8 again
-                exc_info = exc_info.decode("utf-8", "replace").encode("utf-8")

Review comment:
       We dropped Python 2. It doesn't need it anymore.




----------------------------------------------------------------
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:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org