diff options
author | MechCoder <manojkumarsivaraj334@gmail.com> | 2015-08-14 12:46:05 -0700 |
---|---|---|
committer | Xiangrui Meng <meng@databricks.com> | 2015-08-14 12:46:05 -0700 |
commit | ffa05c84fe75663fc33f3d954d1cb1e084ab3280 (patch) | |
tree | eb5599d7c52bf7ddcd72d340952bca83e169c2d0 /python/pyspark/rdd.py | |
parent | ece00566e4d5f38585f2810bef38e526cae7d25e (diff) | |
download | spark-ffa05c84fe75663fc33f3d954d1cb1e084ab3280.tar.gz spark-ffa05c84fe75663fc33f3d954d1cb1e084ab3280.tar.bz2 spark-ffa05c84fe75663fc33f3d954d1cb1e084ab3280.zip |
[SPARK-9828] [PYSPARK] Mutable values should not be default arguments
Author: MechCoder <manojkumarsivaraj334@gmail.com>
Closes #8110 from MechCoder/spark-9828.
Diffstat (limited to 'python/pyspark/rdd.py')
-rw-r--r-- | python/pyspark/rdd.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/python/pyspark/rdd.py b/python/pyspark/rdd.py index fa8e0a0574..9ef60a7e2c 100644 --- a/python/pyspark/rdd.py +++ b/python/pyspark/rdd.py @@ -700,7 +700,7 @@ class RDD(object): return self.map(lambda x: (f(x), x)).groupByKey(numPartitions) @ignore_unicode_prefix - def pipe(self, command, env={}, checkCode=False): + def pipe(self, command, env=None, checkCode=False): """ Return an RDD created by piping elements to a forked external process. @@ -709,6 +709,9 @@ class RDD(object): :param checkCode: whether or not to check the return value of the shell command. """ + if env is None: + env = dict() + def func(iterator): pipe = Popen( shlex.split(command), env=env, stdin=PIPE, stdout=PIPE) |