Skip to content

Commit f71f391

Browse files
committed
Revert changes in python
1 parent 1c2532c commit f71f391

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

python/pyspark/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
u'local'
3131
>>> sc.appName
3232
u'My app'
33-
>>> sc.sparkHome is not None
33+
>>> sc.sparkHome is None
3434
True
3535
3636
>>> conf = SparkConf(loadDefaults=False)

python/pyspark/context.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,8 @@ def _do_init(self, master, appName, sparkHome, pyFiles, environment, batchSize,
126126
self._conf.setMaster(master)
127127
if appName:
128128
self._conf.setAppName(appName)
129+
if sparkHome:
130+
self._conf.setSparkHome(sparkHome)
129131
if environment:
130132
for key, value in environment.iteritems():
131133
self._conf.setExecutorEnv(key, value)
@@ -142,7 +144,7 @@ def _do_init(self, master, appName, sparkHome, pyFiles, environment, batchSize,
142144
# the classpath or an external config file
143145
self.master = self._conf.get("spark.master")
144146
self.appName = self._conf.get("spark.app.name")
145-
self.sparkHome = os.environ.get("SPARK_HOME")
147+
self.sparkHome = self._conf.get("spark.home", None)
146148
for (k, v) in self._conf.getAll():
147149
if k.startswith("spark.executorEnv."):
148150
varName = k[len("spark.executorEnv."):]

0 commit comments

Comments
 (0)