Github user HyukjinKwon commented on a diff in the pull request: https://github.com/apache/spark/pull/13599#discussion_r175670974 --- Diff: core/src/main/scala/org/apache/spark/deploy/PythonRunner.scala --- @@ -39,12 +39,17 @@ object PythonRunner { val pyFiles = args(1) val otherArgs = args.slice(2, args.length) val sparkConf = new SparkConf() - val pythonExec = sparkConf.get(PYSPARK_DRIVER_PYTHON) + var pythonExec = sparkConf.get(PYSPARK_DRIVER_PYTHON) .orElse(sparkConf.get(PYSPARK_PYTHON)) .orElse(sys.env.get("PYSPARK_DRIVER_PYTHON")) .orElse(sys.env.get("PYSPARK_PYTHON")) .getOrElse("python") + if (sparkConf.getBoolean("spark.pyspark.virtualenv.enabled", false)) { + val virtualEnvFactory = new VirtualEnvFactory(pythonExec, sparkConf, true) + pythonExec = virtualEnvFactory.setupVirtualEnv() --- End diff -- correct me if I misunderstood. Couldn't we have some tests to check if `setupVirtualEnv` has a proper string at least?
--- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org