uranusjr commented on code in PR #24046:
URL: https://github.com/apache/airflow/pull/24046#discussion_r886283747


##########
airflow/providers/google/cloud/hooks/dataflow.py:
##########
@@ -972,16 +972,31 @@ def start_sql_job(
         :param on_new_job_callback: Callback called when the job is known.
         :return: the new job object
         """
+        gcp_options = [
+            f"--project={project_id}",
+            "--format=value(job.id)",
+            f"--job-name={job_name}",
+            f"--region={location}",
+        ]
+
+        if self.impersonation_chain:
+            if isinstance(self.impersonation_chain, str):
+                impersonation_account = self.impersonation_chain
+            elif len(self.impersonation_chain) == 1:
+                impersonation_account = self.impersonation_chain[1]

Review Comment:
   Should this be 0 instead?



##########
airflow/providers/google/cloud/hooks/dataflow.py:
##########
@@ -972,16 +972,31 @@ def start_sql_job(
         :param on_new_job_callback: Callback called when the job is known.
         :return: the new job object
         """
+        gcp_options = [
+            f"--project={project_id}",
+            "--format=value(job.id)",
+            f"--job-name={job_name}",
+            f"--region={location}",
+        ]
+
+        if self.impersonation_chain:
+            if isinstance(self.impersonation_chain, str):
+                impersonation_account = self.impersonation_chain
+            elif len(self.impersonation_chain) == 1:
+                impersonation_account = self.impersonation_chain[1]
+            else:
+                raise AirflowException(
+                    "Chained list of accounts is not supported, please specify 
only one service account"
+                )

Review Comment:
   If we don’t support multiple accounts, why do we accept a list in the first 
place? Can we not simply accept the str case?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to