Skip to content
Prev Previous commit
Next Next commit
clean up
  • Loading branch information
dongjoon-hyun authored and HyukjinKwon committed Jul 27, 2020
commit 458da383de5debdf217bd8397e574336bd75244b
Original file line number Diff line number Diff line change
Expand Up @@ -83,12 +83,7 @@ object IntegratedUDFTestUtils extends SQLHelper {
sparkHome, "python", "lib", PythonUtils.PY4J_ZIP_NAME).toAbsolutePath
private lazy val pysparkPythonPath = s"$py4jPath:$sourcePath"

private lazy val isPythonAvailable: Boolean = {
if (!TestUtils.testCommandAvailable(pythonExec)) {
throw new RuntimeException(s"Python executable [$pythonExec] is unavailable.")
}
true
}
private lazy val isPythonAvailable: Boolean = TestUtils.testCommandAvailable(pythonExec)

private lazy val isPySparkAvailable: Boolean = isPythonAvailable && Try {
Process(
Expand Down Expand Up @@ -205,11 +200,8 @@ object IntegratedUDFTestUtils extends SQLHelper {
"PYSPARK_DRIVER_PYTHON", sys.env.getOrElse("PYSPARK_PYTHON", "python3"))
if (TestUtils.testCommandAvailable(pythonExec)) {
pythonExec
} else if (pythonExec.equalsIgnoreCase("python") &&
TestUtils.testCommandAvailable("python3")) {
"python3"
} else {
"python3"
"python"
}
}

Expand Down