ueshin commented on code in PR #50038:
URL: https://github.com/apache/spark/pull/50038#discussion_r1966078097


##########
python/pyspark/logger/logger.py:
##########
@@ -66,10 +67,21 @@ def format(self, record: logging.LogRecord) -> str:
         }
         if record.exc_info:
             exc_type, exc_value, exc_tb = record.exc_info
+            stacktrace = traceback.extract_tb(exc_tb)
+
+            structured_stacktrace = [
+                {
+                    "class": exc_type.__name__ if exc_type else 
"UnknownException",

Review Comment:
   This should be the name of the class in each stack frame, instead of the 
`exc_type.__name__`, but seems like the `frame` object doesn't contain the 
class name. As `exc_type.__name__` is already recorded as `exception.class`, I 
guess we can leave it as `None` here if it's not available?



##########
python/pyspark/logger/logger.py:
##########
@@ -26,7 +27,7 @@
     "msg STRING, "
     "context map<STRING, STRING>, "
     "exception STRUCT<class STRING, msg STRING, "
-    "stacktrace ARRAY<STRUCT<class STRING, method STRING, file STRING,line 
STRING>>>,"
+    "stacktrace ARRAY<STRUCT<class STRING, method STRING, file STRING, line 
STRING>>> ,"

Review Comment:
   👍 



-- 
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.

To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


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

Reply via email to