Skip to content

Commit a5c20db

Browse files
committed
compatible support for python3
1 parent 0cf822f commit a5c20db

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

python/pyspark/tests/test_taskcontext.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,6 @@ def test_barrier_with_python_worker_reuse(self):
148148
reused python worker.
149149
"""
150150
import os
151-
self.sc._conf.set("spark.python.work.reuse", "true")
152151
# start a normal job first to start all workers and get all worker pids
153152
worker_pids = self.sc.parallelize(range(2), 2).map(lambda x: os.getpid()).collect()
154153
# the worker will reuse in this barrier job
@@ -164,8 +163,8 @@ def context_barrier(x):
164163
return (time.time(), os.getpid())
165164

166165
result = rdd.barrier().mapPartitions(f).map(context_barrier).collect()
167-
times = map(lambda x: x[0], result)
168-
pids = map(lambda x: x[1], result)
166+
times = list(map(lambda x: x[0], result))
167+
pids = list(map(lambda x: x[1], result))
169168
# check both barrier and worker reuse effect
170169
self.assertTrue(max(times) - min(times) < 1)
171170
for pid in pids:

0 commit comments

Comments
 (0)