phanikumv commented on code in PR #31872:
URL: https://github.com/apache/airflow/pull/31872#discussion_r1233996450


##########
airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -364,19 +364,21 @@ def execute(self, context: Context) -> None:  # type: 
ignore[override]
 
             job = self._submit_job(hook, job_id="")
             context["ti"].xcom_push(key="job_id", value=job.job_id)
-            self.defer(
-                timeout=self.execution_timeout,
-                trigger=BigQueryValueCheckTrigger(
-                    conn_id=self.gcp_conn_id,
-                    job_id=job.job_id,
-                    project_id=hook.project_id,
-                    sql=self.sql,
-                    pass_value=self.pass_value,
-                    tolerance=self.tol,
-                    poll_interval=self.poll_interval,
-                ),
-                method_name="execute_complete",
-            )
+            if job.running():
+                self.defer(
+                    timeout=self.execution_timeout,
+                    trigger=BigQueryValueCheckTrigger(
+                        conn_id=self.gcp_conn_id,
+                        job_id=job.job_id,
+                        project_id=hook.project_id,
+                        sql=self.sql,
+                        pass_value=self.pass_value,
+                        tolerance=self.tol,
+                        poll_interval=self.poll_interval,
+                    ),
+                    method_name="execute_complete",
+                )
+            self.log.info("Current state of job %s is %s", job.job_id, 
job.state)

Review Comment:
   Hmm, how will user know the status from Airflow otherwise? unless this is 
added, they need to see in BigQuery console



-- 
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