Github user icexelloss commented on a diff in the pull request:
https://github.com/apache/spark/pull/21467#discussion_r192114014
--- Diff: python/pyspark/sql/tests.py ---
@@ -901,20 +901,40 @@ def __call__(self, x):
self.assertEqual(return_type, f_.returnType)
def test_stopiteration_in_udf(self):
- # test for SPARK-23754
- from pyspark.sql.functions import udf
+ from pyspark.sql.functions import udf, pandas_udf, PandasUDFType
from py4j.protocol import Py4JJavaError
+ def do_test(action, *args, **kwargs):
+ with self.assertRaises(Py4JJavaError) as cm:
+ action(*args, **kwargs)
+
+ self.assertIn(
--- End diff --
I think you can use `self.assertRaisesRegex` instead
---
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]