sunjincheng121 commented on a change in pull request #8671:
[FLINK-12787][python] Allow to specify directory in option -pyfs
URL: https://github.com/apache/flink/pull/8671#discussion_r291943230
##########
File path:
flink-python/src/main/java/org/apache/flink/python/client/PythonEnvUtils.java
##########
@@ -127,18 +126,29 @@ public static PythonEnvironment
preparePythonEnvironment(Map<String, Path> fileP
}
// 3. copy relevant python files to tmp dir and set them in
PYTHONPATH.
- filePathMap.forEach((sourceFileName, sourcePath) -> {
+ for (Path pythonFile : pythonLibFiles) {
+ String sourceFileName = pythonFile.getName();
Path targetPath = new Path(tmpDirPath, sourceFileName);
- try {
- FileUtils.copy(sourcePath, targetPath, true);
- } catch (IOException e) {
- LOG.error("Copy files to tmp dir failed", e);
- }
- String targetFileName = targetPath.toString();
+ FileUtils.copy(pythonFile, targetPath, true);
+ String targetFileNames =
Files.walk(Paths.get(targetPath.toString()))
Review comment:
exclude the `.py` files.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services