You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2022/09/01 17:13:50 UTC

[GitHub] [beam] robertwb commented on a diff in pull request #22991: [BEAM-22859] Allow the specification of extra packages for external Python transforms.

robertwb commented on code in PR #22991:
URL: https://github.com/apache/beam/pull/22991#discussion_r960911945


##########
sdks/java/extensions/python/src/test/java/org/apache/beam/sdk/extensions/python/PythonExternalTransformTest.java:
##########
@@ -60,6 +66,23 @@ public void trivialPythonTransform() {
     // TODO: Run this on a multi-language supporting runner.
   }
 
+  @Ignore("https://github.com/apache/beam/issues/21561")
+  @Test
+  @Category({ValidatesRunner.class, UsesPythonExpansionService.class})
+  public void pythonTransformWithDependencies() {
+    Pipeline p = Pipeline.create();
+    PCollection<String> output =
+        p.apply(Create.of("elephant", "mouse", "sheep"))
+            .apply(
+                PythonExternalTransform.<PCollection<String>, PCollection<String>>from(
+                        "apache_beam.Map")
+                    .withArgs(PythonCallableSource.of("import inflection\ninflection.pluralize"))
+                    .withExtraPackages(ImmutableList.of("inflection"))
+                    .withOutputCoder(StringUtf8Coder.of()));
+    PAssert.that(output).containsInAnyOrder("elephants", "mice", "sheep");
+    // TODO: Run this on a multi-language supporting runner.

Review Comment:
   Yes. 



-- 
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: github-unsubscribe@beam.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org