HyukjinKwon commented on code in PR #39450:
URL: https://github.com/apache/spark/pull/39450#discussion_r1088566676
##########
python/pyspark/sql/tests/test_functions.py:
##########
@@ -1015,48 +1015,42 @@ def test_assert_true(self):
[Row(val=None), Row(val=None), Row(val=None)],
)
- with self.assertRaises(Py4JJavaError) as cm:
+ with self.assertRaisesRegex((Py4JJavaError, SparkConnectException),
"too big"):
df.select(assert_true(df.id < 2, "too big")).toDF("val").collect()
- self.assertIn("java.lang.RuntimeException", str(cm.exception))
- self.assertIn("too big", str(cm.exception))
- with self.assertRaises(Py4JJavaError) as cm:
+ with self.assertRaisesRegex((Py4JJavaError, SparkConnectException),
"2000000"):
df.select(assert_true(df.id < 2, df.id *
1e6)).toDF("val").collect()
- self.assertIn("java.lang.RuntimeException", str(cm.exception))
- self.assertIn("2000000", str(cm.exception))
- with self.assertRaises(PySparkTypeError) as pe:
+ with self.assertRaises((PySparkTypeError, TypeError)) as pe:
Review Comment:
@itholic I think we should fix this not to throw `TypeError` too for Spark
Connect.
--
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]