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

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

     [ https://issues.apache.org/jira/browse/SPARK-3415?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Josh Rosen resolved SPARK-3415.
-------------------------------
       Resolution: Fixed
    Fix Version/s: 1.2.0

Issue resolved by pull request 2287
[https://github.com/apache/spark/pull/2287]

> 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
>          Components: PySpark
>    Affects Versions: 1.0.2, 1.1.0
>            Reporter: Ward Viaene
>              Labels: python
>             Fix For: 1.2.0
>
>
> 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