Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fix-9525] [Worker] Environment did not work as expected #9527

Merged
merged 4 commits into from
Apr 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -238,10 +238,8 @@ private String buildPythonScriptContent() throws Exception {
private String buildPythonExecuteCommand(String pythonFile) {
Preconditions.checkNotNull(pythonFile, "Python file cannot be null");

String pythonHome = System.getenv(PYTHON_HOME);
if (StringUtils.isEmpty(pythonHome)) {
return DEFAULT_PYTHON_VERSION + " " + pythonFile;
}
String pythonHome = String.format("${%s}", PYTHON_HOME);

return pythonHome + " " + pythonFile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void buildPythonExecuteCommand() throws Exception {
String methodName = "buildPythonExecuteCommand";
String pythonFile = "test.py";
String result1 = Whitebox.invokeMethod(pythonTask, methodName, pythonFile);
Assert.assertEquals("python test.py", result1);
Assert.assertEquals("${PYTHON_HOME} test.py", result1);
}

private PythonTask createPythonTask() {
Expand Down