Skip to content

Commit a307d13

Browse files
update rdd tests to test pipe modes
1 parent 34fcdc3 commit a307d13

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

python/pyspark/tests.py

+5-1
Original file line numberDiff line numberDiff line change
@@ -878,10 +878,14 @@ def test_pipe_functions(self):
878878
data = ['1', '2', '3']
879879
rdd = self.sc.parallelize(data)
880880
with QuietTest(self.sc):
881-
self.assertRaises(Py4JJavaError, rdd.pipe('cc').collect)
881+
self.assertEqual([], rdd.pipe('cc').collect())
882+
self.assertRaises(Py4JJavaError, rdd.pipe('cc', mode='strict').collect)
882883
result = rdd.pipe('cat').collect()
883884
result.sort()
884885
[self.assertEqual(x, y) for x, y in zip(data, result)]
886+
self.assertRaises(Py4JJavaError, rdd.pipe('grep 4', mode='strict').collect)
887+
self.assertEqual([], rdd.pipe('grep 4').collect())
888+
self.assertEqual([], rdd.pipe('grep 4', mode='grep').collect())
885889

886890

887891
class ProfilerTests(PySparkTestCase):

0 commit comments

Comments
 (0)