This is an automated email from the ASF dual-hosted git repository.

gurwls223 pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/spark.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 0a8e192  [SPARK-32447][CORE][PYTHON][FOLLOW-UP] Fix other occurrences 
of 'python' to 'python3'
0a8e192 is described below

commit 0a8e192c4cab0344cf7564694cf39f71c37839b4
Author: HyukjinKwon <[email protected]>
AuthorDate: Sun Dec 13 10:41:47 2020 +0900

    [SPARK-32447][CORE][PYTHON][FOLLOW-UP] Fix other occurrences of 'python' to 
'python3'
    
    ### What changes were proposed in this pull request?
    
    This PR proposes to change python to python3 in several places missed.
    
    ### Why are the changes needed?
    
    To use Python 3 by default safely.
    
    ### Does this PR introduce _any_ user-facing change?
    
    Yes, it will uses `python3` as its default Python interpreter.
    
    ### How was this patch tested?
    
    It was tested together in https://github.com/apache/spark/pull/30735. The 
test cases there will verify this change together.
    
    Closes #30750 from HyukjinKwon/SPARK-32447.
    
    Authored-by: HyukjinKwon <[email protected]>
    Signed-off-by: HyukjinKwon <[email protected]>
    (cherry picked from commit e2cdfcebd9b39a1104b34d8eafafbcdc6acf5d3e)
    Signed-off-by: HyukjinKwon <[email protected]>
---
 core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala          | 2 +-
 .../main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java  | 2 +-
 python/pyspark/context.py                                               | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala 
b/core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala
index 7ad92da..c3f73ed 100644
--- a/core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala
+++ b/core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala
@@ -44,7 +44,7 @@ object PythonRunner {
       .orElse(sparkConf.get(PYSPARK_PYTHON))
       .orElse(sys.env.get("PYSPARK_DRIVER_PYTHON"))
       .orElse(sys.env.get("PYSPARK_PYTHON"))
-      .getOrElse("python")
+      .getOrElse("python3")
 
     // Format python file paths before adding them to the PYTHONPATH
     val formattedPythonFile = formatPath(pythonFile)
diff --git 
a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java
 
b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java
index d6ed1e3..b2c12973 100644
--- 
a/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java
+++ 
b/launcher/src/main/java/org/apache/spark/launcher/SparkSubmitCommandBuilder.java
@@ -336,7 +336,7 @@ class SparkSubmitCommandBuilder extends 
AbstractCommandBuilder {
       conf.get(SparkLauncher.PYSPARK_PYTHON),
       System.getenv("PYSPARK_DRIVER_PYTHON"),
       System.getenv("PYSPARK_PYTHON"),
-      "python"));
+      "python3"));
     String pyOpts = System.getenv("PYSPARK_DRIVER_PYTHON_OPTS");
     if (conf.containsKey(SparkLauncher.PYSPARK_PYTHON)) {
       // pass conf spark.pyspark.python to python by environment variable.
diff --git a/python/pyspark/context.py b/python/pyspark/context.py
index 3da535b..79fdd22 100644
--- a/python/pyspark/context.py
+++ b/python/pyspark/context.py
@@ -227,7 +227,7 @@ class SparkContext(object):
         os.environ["SPARK_BUFFER_SIZE"] = \
             str(self._jvm.PythonUtils.getSparkBufferSize(self._jsc))
 
-        self.pythonExec = os.environ.get("PYSPARK_PYTHON", 'python')
+        self.pythonExec = os.environ.get("PYSPARK_PYTHON", 'python3')
         self.pythonVer = "%d.%d" % sys.version_info[:2]
 
         # Broadcast's __reduce__ method stores Broadcast instances here.


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to