Skip to content

Commit 8b1ee1c

Browse files
committed
[SPARK-54189][K8S] Remove spark.kubernetes.pyspark.pythonVersion
### What changes were proposed in this pull request? This PR aims to remove no-op `spark.kubernetes.pyspark.pythonVersion` configuration. ### Why are the changes needed? `spark.kubernetes.pyspark.pythonVersion` was deprecated at Apache Spark 3.1.0 when Python 2 was dropped. It automatically fails when we use other values than `3`. And, technically no-op. We can remove this safely. https://github.com/apache/spark/blob/84a3fa07ed5f7281282287f830ab6deefae5ccb9/resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala#L598 ### Does this PR introduce _any_ user-facing change? No behavior change. ### How was this patch tested? Pass the CIs. ### Was this patch authored or co-authored using generative AI tooling? No. Closes #52889 from dongjoon-hyun/SPARK-54189. Authored-by: Dongjoon Hyun <[email protected]> Signed-off-by: Dongjoon Hyun <[email protected]>
1 parent 1ec4b71 commit 8b1ee1c

File tree

3 files changed

+1
-38
lines changed

3 files changed

+1
-38
lines changed

docs/running-on-kubernetes.md

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1284,17 +1284,6 @@ See the [configuration page](configuration.html) for information on Spark config
12841284
</td>
12851285
<td>2.4.0</td>
12861286
</tr>
1287-
<tr>
1288-
<td><code>spark.kubernetes.pyspark.pythonVersion</code></td>
1289-
<td><code>"3"</code></td>
1290-
<td>
1291-
This sets the major Python version of the docker image used to run the driver and executor containers.
1292-
It can be only "3". This configuration was deprecated from Spark 3.1.0, and is effectively no-op.
1293-
Users should set 'spark.pyspark.python' and 'spark.pyspark.driver.python' configurations or
1294-
'PYSPARK_PYTHON' and 'PYSPARK_DRIVER_PYTHON' environment variables.
1295-
</td>
1296-
<td>2.4.0</td>
1297-
</tr>
12981287
<tr>
12991288
<td><code>spark.kubernetes.kerberos.krb5.path</code></td>
13001289
<td><code>(none)</code></td>

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/Config.scala

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ import java.util.concurrent.TimeUnit
2121

2222
import org.apache.spark.deploy.k8s.Constants._
2323
import org.apache.spark.internal.Logging
24-
import org.apache.spark.internal.config.{ConfigBuilder, PYSPARK_DRIVER_PYTHON, PYSPARK_PYTHON}
24+
import org.apache.spark.internal.config.ConfigBuilder
2525

2626
private[spark] object Config extends Logging {
2727

@@ -587,22 +587,6 @@ private[spark] object Config extends Logging {
587587
"Ensure that memory overhead is non-negative")
588588
.createWithDefault(0.1)
589589

590-
val PYSPARK_MAJOR_PYTHON_VERSION =
591-
ConfigBuilder("spark.kubernetes.pyspark.pythonVersion")
592-
.doc(
593-
s"(Deprecated since Spark 3.1, please set '${PYSPARK_PYTHON.key}' and " +
594-
s"'${PYSPARK_DRIVER_PYTHON.key}' configurations or $ENV_PYSPARK_PYTHON and " +
595-
s"$ENV_PYSPARK_DRIVER_PYTHON environment variables instead.)")
596-
.version("2.4.0")
597-
.stringConf
598-
.checkValue("3" == _,
599-
"Python 2 was dropped from Spark 3.1, and only 3 is allowed in " +
600-
"this configuration. Note that this configuration was deprecated in Spark 3.1. " +
601-
s"Please set '${PYSPARK_PYTHON.key}' and '${PYSPARK_DRIVER_PYTHON.key}' " +
602-
s"configurations or $ENV_PYSPARK_PYTHON and $ENV_PYSPARK_DRIVER_PYTHON environment " +
603-
"variables instead.")
604-
.createOptional
605-
606590
val KUBERNETES_KERBEROS_KRB5_FILE =
607591
ConfigBuilder("spark.kubernetes.kerberos.krb5.path")
608592
.doc("Specify the local location of the krb5.conf file to be mounted on the driver " +

resource-managers/kubernetes/core/src/main/scala/org/apache/spark/deploy/k8s/features/DriverCommandFeatureStep.scala

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ import org.apache.spark.deploy.k8s.Config._
2525
import org.apache.spark.deploy.k8s.Constants._
2626
import org.apache.spark.deploy.k8s.submit._
2727
import org.apache.spark.internal.Logging
28-
import org.apache.spark.internal.LogKeys.{CONFIG, CONFIG2, CONFIG3, CONFIG4, CONFIG5}
2928
import org.apache.spark.internal.config.{PYSPARK_DRIVER_PYTHON, PYSPARK_PYTHON}
3029
import org.apache.spark.launcher.SparkLauncher
3130

@@ -77,15 +76,6 @@ private[spark] class DriverCommandFeatureStep(conf: KubernetesDriverConf)
7776
private[spark] def environmentVariables: Map[String, String] = sys.env
7877

7978
private def configureForPython(pod: SparkPod, res: String): SparkPod = {
80-
if (conf.get(PYSPARK_MAJOR_PYTHON_VERSION).isDefined) {
81-
logWarning(
82-
log"${MDC(CONFIG, PYSPARK_MAJOR_PYTHON_VERSION.key)} was deprecated in Spark 3.1. " +
83-
log"Please set '${MDC(CONFIG2, PYSPARK_PYTHON.key)}' and " +
84-
log"'${MDC(CONFIG3, PYSPARK_DRIVER_PYTHON.key)}' " +
85-
log"configurations or ${MDC(CONFIG4, ENV_PYSPARK_PYTHON)} and " +
86-
log"${MDC(CONFIG5, ENV_PYSPARK_DRIVER_PYTHON)} environment variables instead.")
87-
}
88-
8979
val pythonEnvs = {
9080
KubernetesUtils.buildEnvVars(
9181
Seq(

0 commit comments

Comments
 (0)