Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/21383#discussion_r190449424 --- Diff: python/pyspark/tests.py --- @@ -1246,6 +1277,31 @@ def test_pipe_unicode(self): result = rdd.pipe('cat').collect() self.assertEqual(data, result) + def test_stopiteration_in_client_code(self): + + def a_rdd(keyed=False): + return self.sc.parallelize( + ((x % 2, x) if keyed else x) + for x in range(10) + ) + + def stopit(*x): + raise StopIteration() + + def do_test(action, *args, **kwargs): + with self.assertRaises((Py4JJavaError, RuntimeError)) as cm: + action(*args, **kwargs) + + do_test(a_rdd().map(stopit).collect) --- End diff -- Maybe we could do: ``` self.assertRaises(RuntimeError, rdd.map(stopit).collect) ```
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org