This is an automated email from the ASF dual-hosted git repository.

robertwb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/beam.git


The following commit(s) were added to refs/heads/master by this push:
     new 97a52af980d [yaml] support gcs location for main.py yaml input file 
(#29014)
97a52af980d is described below

commit 97a52af980d521cfbeba1c3f272942cf39d555f1
Author: Jeff Kinard <[email protected]>
AuthorDate: Fri Oct 20 19:08:58 2023 -0400

    [yaml] support gcs location for main.py yaml input file (#29014)
---
 sdks/python/apache_beam/yaml/main.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/sdks/python/apache_beam/yaml/main.py 
b/sdks/python/apache_beam/yaml/main.py
index e2ec8df9cfc..331b9e7b361 100644
--- a/sdks/python/apache_beam/yaml/main.py
+++ b/sdks/python/apache_beam/yaml/main.py
@@ -20,6 +20,7 @@ import argparse
 import yaml
 
 import apache_beam as beam
+from apache_beam.io.filesystems import FileSystems
 from apache_beam.typehints.schemas import LogicalType
 from apache_beam.typehints.schemas import MillisInstant
 from apache_beam.yaml import yaml_transform
@@ -43,8 +44,8 @@ def _pipeline_spec_from_args(known_args):
     raise ValueError(
         "Exactly one of pipeline_spec or pipeline_spec_file must be set.")
   elif known_args.pipeline_spec_file:
-    with open(known_args.pipeline_spec_file) as fin:
-      pipeline_yaml = fin.read()
+    with FileSystems.open(known_args.pipeline_spec_file) as fin:
+      pipeline_yaml = fin.read().decode()
   elif known_args.pipeline_spec:
     pipeline_yaml = known_args.pipeline_spec
   else:

Reply via email to