From 96670b43490b62225356cbbd4ff8cbc9759feb8a Mon Sep 17 00:00:00 2001 From: tverdokhlib Date: Tue, 23 Jan 2024 00:34:00 +0000 Subject: [PATCH] Fix location requirement in DataflowTemplatedJobStartOperator --- airflow/providers/google/cloud/operators/dataflow.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/airflow/providers/google/cloud/operators/dataflow.py b/airflow/providers/google/cloud/operators/dataflow.py index ec813c55eb397..852a79d42927a 100644 --- a/airflow/providers/google/cloud/operators/dataflow.py +++ b/airflow/providers/google/cloud/operators/dataflow.py @@ -677,6 +677,9 @@ def set_current_job(current_job): options = self.dataflow_default_options options.update(self.options) + if not self.location: + self.location = DEFAULT_DATAFLOW_LOCATION + self.job = self.hook.start_template_dataflow( job_name=self.job_name, variables=options, @@ -704,7 +707,7 @@ def set_current_job(current_job): trigger=TemplateJobStartTrigger( project_id=self.project_id, job_id=job_id, - location=self.location if self.location else DEFAULT_DATAFLOW_LOCATION, + location=self.location, gcp_conn_id=self.gcp_conn_id, poll_sleep=self.poll_sleep, impersonation_chain=self.impersonation_chain,