Skip to content

Commit e967eca

Browse files
Marcelo VanzinJoshRosen
authored andcommitted
[SPARK-6506] [pyspark] Do not try to retrieve SPARK_HOME when not needed...
.... In particular, this makes pyspark in yarn-cluster mode fail unless SPARK_HOME is set, when it's not really needed. Author: Marcelo Vanzin <[email protected]> Closes #5405 from vanzin/SPARK-6506 and squashes the following commits: e184507 [Marcelo Vanzin] [SPARK-6506] [pyspark] Do not try to retrieve SPARK_HOME when not needed. (cherry picked from commit f7e21dd) Signed-off-by: Josh Rosen <[email protected]>
1 parent cdef7d0 commit e967eca

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

python/pyspark/java_gateway.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,10 @@
2929

3030

3131
def launch_gateway():
32-
SPARK_HOME = os.environ["SPARK_HOME"]
33-
3432
if "PYSPARK_GATEWAY_PORT" in os.environ:
3533
gateway_port = int(os.environ["PYSPARK_GATEWAY_PORT"])
3634
else:
35+
SPARK_HOME = os.environ["SPARK_HOME"]
3736
# Launch the Py4j gateway using Spark's run command so that we pick up the
3837
# proper classpath and settings from spark-env.sh
3938
on_windows = platform.system() == "Windows"

0 commit comments

Comments
 (0)