You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by po...@apache.org on 2022/04/30 09:13:22 UTC

[airflow] branch main updated: Allow back script_location in Glue to be None (#23357)

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

potiuk pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new fa0d93418b Allow back script_location in Glue to be None (#23357)
fa0d93418b is described below

commit fa0d93418b026f9822c8ffc0521381f019ef7821
Author: Jarek Potiuk <ja...@polidea.com>
AuthorDate: Sat Apr 30 11:12:58 2022 +0200

    Allow back script_location in Glue to be None (#23357)
---
 airflow/providers/amazon/aws/operators/glue.py | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/airflow/providers/amazon/aws/operators/glue.py b/airflow/providers/amazon/aws/operators/glue.py
index 05eafe7269..cb76e78430 100644
--- a/airflow/providers/amazon/aws/operators/glue.py
+++ b/airflow/providers/amazon/aws/operators/glue.py
@@ -104,7 +104,9 @@ class GlueJobOperator(BaseOperator):
 
         :return: the id of the current glue job.
         """
-        if not self.script_location.startswith(self.s3_protocol):
+        if self.script_location is None:
+            s3_script_location = None
+        elif not self.script_location.startswith(self.s3_protocol):
             s3_hook = S3Hook(aws_conn_id=self.aws_conn_id)
             script_name = os.path.basename(self.script_location)
             s3_hook.load_file(