Skip to content

Commit

Permalink
Merge pull request #29173 [YAML] add GCS support for external transfo…
Browse files Browse the repository at this point in the history
…rm jars
  • Loading branch information
robertwb authored Oct 27, 2023
2 parents 1f7e882 + 0d5469e commit ab2ab2f
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion sdks/python/apache_beam/utils/subprocess_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@

import grpc

from apache_beam.io.filesystems import FileSystems
from apache_beam.version import __version__ as beam_version

_LOGGER = logging.getLogger(__name__)
Expand Down Expand Up @@ -272,7 +273,10 @@ def local_jar(cls, url, cache_dir=None):
os.makedirs(cache_dir)
# TODO: Clean up this cache according to some policy.
try:
url_read = urlopen(url)
try:
url_read = FileSystems.open(url)
except ValueError:
url_read = urlopen(url)
with open(cached_jar + '.tmp', 'wb') as jar_write:
shutil.copyfileobj(url_read, jar_write, length=1 << 20)
os.rename(cached_jar + '.tmp', cached_jar)
Expand Down

0 comments on commit ab2ab2f

Please sign in to comment.