You are viewing a plain text version of this content. The canonical link for it is here.
Posted to reviews@spark.apache.org by "itholic (via GitHub)" <gi...@apache.org> on 2023/09/25 04:56:13 UTC

[GitHub] [spark] itholic commented on a diff in pull request #42985: [SPARK-44838][SQL][WIP] raise_error improvement

itholic commented on code in PR #42985:
URL: https://github.com/apache/spark/pull/42985#discussion_r1335371923


##########
python/pyspark/sql/tests/test_functions.py:
##########
@@ -1032,9 +1032,11 @@ def check_assert_true(self, tpe):
         )
 
         with self.assertRaisesRegex(tpe, "too big"):
-            df.select(F.assert_true(df.id < 2, "too big")).toDF("val").collect()
+            df.select(F.assert_true(df.id < 2, "[USER_RAISED_EXCEPTION] too big")).toDF(
+                "val"
+            ).collect()
 
-        with self.assertRaisesRegex(tpe, "2000000"):
+        with self.assertRaisesRegex(tpe, "[USER_RAISED_EXCEPTION] 2000000.0"):

Review Comment:
   ```suggestion
           with self.assertRaisesRegex(tpe, "\[USER_RAISED_EXCEPTION\] 2000000.0"):
   ```
   
   Maybe this should work? `[` is treated as a special character for regex, so we should escape it.



-- 
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-unsubscribe@spark.apache.org

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