cloud-fan commented on code in PR #45377:
URL: https://github.com/apache/spark/pull/45377#discussion_r1551362982


##########
sql/api/src/main/scala/org/apache/spark/sql/catalyst/trees/QueryContexts.scala:
##########
@@ -165,6 +172,20 @@ case class DataFrameQueryContext(stackTrace: 
Seq[StackTraceElement]) extends Que
     builder ++= " was called from\n"
     builder ++= callSite
     builder += '\n'
+
+    if (pysparkOriginInfo.nonEmpty) {
+      builder ++= "\n== PySpark call site ==\n"
+      builder ++= "\""
+
+      builder ++= pysparkFragment
+      builder ++= "\""
+      builder ++= " was called from\n"
+      builder ++= pysparkCallSite
+      builder += '\n'
+    }
+
+    PySparkCurrentOrigin.clear()

Review Comment:
   it looks tricky to call `clear` inside a `lazy val`...



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to