You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@spark.apache.org by "Ward Viaene (JIRA)" <ji...@apache.org> on 2014/09/05 15:11:29 UTC

[jira] [Created] (SPARK-3415) Using sys.stderr in pyspark results in error

Ward Viaene created SPARK-3415:
----------------------------------

             Summary: Using sys.stderr in pyspark results in error
                 Key: SPARK-3415
                 URL: https://issues.apache.org/jira/browse/SPARK-3415
             Project: Spark
          Issue Type: Bug
            Reporter: Ward Viaene


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()




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@spark.apache.org
For additional commands, e-mail: issues-help@spark.apache.org