RNHTTR commented on code in PR #40863:
URL: https://github.com/apache/airflow/pull/40863#discussion_r1686602738


##########
airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -3021,7 +3021,15 @@ def execute(self, context: Any):
         # Wait for the job to complete
         if not self.deferrable:
             job.result(timeout=self.result_timeout, retry=self.result_retry)
-            self._handle_job_error(job)
+            while True:
+                if job.state in ("PENDING", "RUNNING"):
+                    import time
+
+                    time.sleep(5)
+                    job.result(timeout=self.result_timeout, 
retry=self.result_retry)

Review Comment:
   will calling `job.result` trigger a new job?



##########
airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -3021,7 +3021,15 @@ def execute(self, context: Any):
         # Wait for the job to complete
         if not self.deferrable:
             job.result(timeout=self.result_timeout, retry=self.result_retry)
-            self._handle_job_error(job)
+            while True:

Review Comment:
   I'd like to hear the Google team's opinion, but having another look at 
[QueryJob's result 
method](https://github.com/googleapis/python-bigquery/blob/ba61a8ab0da541ba1940211875d7ea2e9e17dfa8/google/cloud/bigquery/job/query.py#L1673-L1690),
 I'm not sure this is even necessary, because `result` now has logic to 
determine whether or not a job is `DONE`.



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