aboutsummaryrefslogtreecommitdiff
path: root/python/pyspark/conf.py
diff options
context:
space:
mode:
authorMatei Zaharia <matei@databricks.com>2014-01-01 23:21:34 -0500
committerMatei Zaharia <matei@databricks.com>2014-01-01 23:21:34 -0500
commit7e8d2e8a5c88d16c771923504c433491b109ab2a (patch)
treeff3aa8fa3460078007259a6a6479dc4aec27b50a /python/pyspark/conf.py
parent0f6060733da83a862038fd397875cdb49d8c144d (diff)
downloadspark-7e8d2e8a5c88d16c771923504c433491b109ab2a.tar.gz
spark-7e8d2e8a5c88d16c771923504c433491b109ab2a.tar.bz2
spark-7e8d2e8a5c88d16c771923504c433491b109ab2a.zip
Fix Python code after change of getOrElse
Diffstat (limited to 'python/pyspark/conf.py')
-rw-r--r--python/pyspark/conf.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/python/pyspark/conf.py b/python/pyspark/conf.py
index c111e2e90f..d72aed6a30 100644
--- a/python/pyspark/conf.py
+++ b/python/pyspark/conf.py
@@ -134,7 +134,12 @@ class SparkConf(object):
def get(self, key, defaultValue=None):
"""Get the configured value for some key, or return a default otherwise."""
- return self._jconf.get(key, defaultValue)
+ if defaultValue == None: # Py4J doesn't call the right get() if we pass None
+ if not self._jconf.contains(key):
+ return None
+ return self._jconf.get(key)
+ else:
+ return self._jconf.get(key, defaultValue)
def getAll(self):
"""Get all values as a list of key-value pairs."""