aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorMatei Zaharia <matei@databricks.com>2014-01-01 22:03:39 -0500
committerMatei Zaharia <matei@databricks.com>2014-01-01 22:03:39 -0500
commite2c68642c64345434e2034082cf9b299491e9e9f (patch)
tree8367e90bf00d2a40257a6465ad4ee4b5403f0411 /python
parent45ff8f413d9959b7f464176cd20dc56db3f711af (diff)
downloadspark-e2c68642c64345434e2034082cf9b299491e9e9f.tar.gz
spark-e2c68642c64345434e2034082cf9b299491e9e9f.tar.bz2
spark-e2c68642c64345434e2034082cf9b299491e9e9f.zip
Miscellaneous fixes from code review.
Also replaced SparkConf.getOrElse with just a "get" that takes a default value, and added getInt, getLong, etc to make code that uses this simpler later on.
Diffstat (limited to 'python')
-rw-r--r--python/pyspark/conf.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/python/pyspark/conf.py b/python/pyspark/conf.py
index 9dcdcfaa67..c111e2e90f 100644
--- a/python/pyspark/conf.py
+++ b/python/pyspark/conf.py
@@ -93,7 +93,7 @@ class SparkConf(object):
def set(self, key, value):
"""Set a configuration property."""
- self._jconf.set(key, value)
+ self._jconf.set(key, unicode(value))
return self
def setMaster(self, value):
@@ -132,13 +132,9 @@ class SparkConf(object):
self._jconf.set(k, v)
return self
- def get(self, key):
- """Get the configured value for some key, if set."""
- return self._jconf.get(key)
-
- def getOrElse(self, key, defaultValue):
- """Get the value for some key, or return a default otherwise."""
- return self._jconf.getOrElse(key, defaultValue)
+ def get(self, key, defaultValue=None):
+ """Get the configured value for some key, or return a default otherwise."""
+ return self._jconf.get(key, defaultValue)
def getAll(self):
"""Get all values as a list of key-value pairs."""