You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "hussein-awala (via GitHub)" <gi...@apache.org> on 2023/06/18 20:21:27 UTC

[GitHub] [airflow] hussein-awala commented on a diff in pull request #31645: Allow downloading requirements file from GCS in `BeamRunPythonPipelineOperator`

hussein-awala commented on code in PR #31645:
URL: https://github.com/apache/airflow/pull/31645#discussion_r1233371942


##########
airflow/providers/apache/beam/operators/beam.py:
##########
@@ -294,10 +294,13 @@ def execute(self, context: Context):
             raise AirflowException("Beam hook is not defined.")
 
         with ExitStack() as exit_stack:
+            gcs_hook = GCSHook(gcp_conn_id=self.gcp_conn_id)
             if self.py_file.lower().startswith("gs://"):
-                gcs_hook = GCSHook(gcp_conn_id=self.gcp_conn_id)
                 tmp_gcs_file = exit_stack.enter_context(gcs_hook.provide_file(object_url=self.py_file))
                 self.py_file = tmp_gcs_file.name
+            if snake_case_pipeline_options.get("requirements_file", "").startswith("gs://"):
+                tmp_req_file = exit_stack.enter_context(gcs_hook.provide_file(object_url=snake_case_pipeline_options["requirements_file"]))

Review Comment:
   ```suggestion
                   tmp_req_file = exit_stack.enter_context(
                       gcs_hook.provide_file(object_url=snake_case_pipeline_options["requirements_file"])
                    )
   ```



-- 
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: commits-unsubscribe@airflow.apache.org

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