eugenegujing commented on code in PR #9215:
URL: https://github.com/apache/texera/pull/9215#discussion_r4691525890


##########
common/workflow-compiler/src/main/scala/org/apache/texera/common/compiler/WorkflowCompiler.scala:
##########
@@ -307,7 +307,9 @@ class WorkflowCompiler(
               // **Check for Python-based operator errors during code 
generation**
               if (physicalOp.isPythonBased) {
                 val code = physicalOp.getCode
-                val exceptionPattern = """#EXCEPTION DURING CODE 
GENERATION:\s*(.*)""".r
+                // The marker is the whole code of a failed generation, so it 
is only looked for
+                // at the very start; `(?s)` lets the captured message span 
several lines.
+                val exceptionPattern = """(?s)^#EXCEPTION DURING CODE 
GENERATION:\s*(.*)""".r

Review Comment:
   Sure, done in 83e2c4b10fc26a2452582821f63c5fce52a09310



##########
common/workflow-operator/src/main/scala/org/apache/texera/amber/operator/PythonOperatorDescriptor.scala:
##########
@@ -26,7 +26,9 @@ import org.apache.texera.amber.core.workflow.{PhysicalOp, 
PortIdentity, SchemaPr
 
 trait PythonOperatorDescriptor extends LogicalOp {
   private def generatePythonCodeForRaisingException(ex: Throwable): String = {
-    s"#EXCEPTION DURING CODE GENERATION: ${ex.getMessage}"
+    // An exception with no message or an empty one is reported by its type 
instead of "null".
+    val message = 
Option(ex.getMessage).filter(_.nonEmpty).getOrElse(ex.toString)

Review Comment:
   Fixed in 83e2c4b10fc26a2452582821f63c5fce52a09310



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

Reply via email to