robertwb commented on code in PR #22991:
URL: https://github.com/apache/beam/pull/22991#discussion_r960912369
##########
sdks/java/extensions/python/src/main/java/org/apache/beam/sdk/extensions/python/PythonExternalTransform.java:
##########
@@ -418,13 +433,24 @@ public OutputT expand(InputT input) {
return apply(input, expansionService, payload);
} else {
int port = PythonService.findAvailablePort();
+ ImmutableList.Builder<String> args = ImmutableList.builder();
+ args.add("--port", "" + port, "--fully_qualified_name_glob", "*");
+ if (!extraPackages.isEmpty()) {
+ File requirementsFile = File.createTempFile("requirements", ".txt");
+ requirementsFile.deleteOnExit();
+ try (FileWriter fout =
+ new FileWriter(requirementsFile.getAbsolutePath(),
Charsets.UTF_8)) {
+ for (String pkg : extraPackages) {
+ fout.write(pkg);
+ fout.write('\n');
+ }
+ }
+ args.add("--requirements_file=" +
requirementsFile.getAbsolutePath());
Review Comment:
This hooks into the standard file staging mechanisms that "ordinary" Python
pipelines use.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]