pabloem commented on a change in pull request #16613:
URL: https://github.com/apache/beam/pull/16613#discussion_r798050504



##########
File path: sdks/python/apache_beam/transforms/external.py
##########
@@ -694,12 +695,31 @@ class JavaJarExpansionService(object):
   def __init__(self, path_to_jar, extra_args=None, classpath=None):
     self._path_to_jar = path_to_jar
     self._extra_args = extra_args
-    self._classpath = classpath
+    self._classpath = classpath or []
     self._service_count = 0
 
+  @staticmethod
+  def _expand_jars(jar):
+    if glob.glob(jar):
+      return glob.glob(jar)
+    elif isinstance(jar, str) and (jar.startswith('http://') or
+                                   jar.startswith('https://')):
+      return [jar]
+    else:
+      try:
+        group_id, artifact_id, version = jar.split(':')
+      except ValueError:
+        # If we are not able to
+        logging.warning('Unable to parse %s into group:artifact:version.', jar)
+        return [jar]

Review comment:
       see in `external_test.py:JavaJarExpansionServiceTest.test_classpath`, we 
choose to include any JARs that are not found in the path but that are passed 
by the user. I am not sure of the motivation, but this is necessary to meet 
that test case




-- 
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]


Reply via email to