From e184507eba7f02fd5b97ae3a6bede7e81edbea8b Mon Sep 17 00:00:00 2001 From: Marcelo Vanzin Date: Tue, 7 Apr 2015 17:59:53 -0700 Subject: [PATCH] [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. --- python/pyspark/java_gateway.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python/pyspark/java_gateway.py b/python/pyspark/java_gateway.py index 0a16cbd8bff62..2a5e84a7dfdb4 100644 --- a/python/pyspark/java_gateway.py +++ b/python/pyspark/java_gateway.py @@ -29,11 +29,10 @@ def launch_gateway(): - SPARK_HOME = os.environ["SPARK_HOME"] - if "PYSPARK_GATEWAY_PORT" in os.environ: gateway_port = int(os.environ["PYSPARK_GATEWAY_PORT"]) else: + SPARK_HOME = os.environ["SPARK_HOME"] # Launch the Py4j gateway using Spark's run command so that we pick up the # proper classpath and settings from spark-env.sh on_windows = platform.system() == "Windows"