Description
Using sys.stderr in pyspark results in:
File "/home/spark-1.1/dist/python/pyspark/cloudpickle.py", line 660, in save_file
from ..transport.adapter import SerializingAdapter
ValueError: Attempted relative import beyond toplevel package
Code to reproduce (copy paste the code in pyspark):
import sys
class TestClass(object):
def _init_(self, out = sys.stderr):
self.out = out
def getOne(self):
return 'one'
def f():
print type(t)
return 'ok'
t = TestClass()
a = [ 1 , 2, 3, 4, 5 ]
b = sc.parallelize(a)
b.map(lambda x: f()).first()
Attachments
Issue Links
- links to