uranusjr commented on code in PR #26768:
URL: https://github.com/apache/airflow/pull/26768#discussion_r983022673
##########
airflow/providers/google/cloud/transfers/gcs_to_bigquery.py:
##########
@@ -319,9 +319,10 @@ def execute(self, context: Context):
location=self.location,
use_legacy_sql=False,
)
- row = list(bq_hook.get_job(job_id=job_id,
location=self.location).result())
- if row:
- max_id = row[0] if row[0] else 0
+ result = list(bq_hook.get_job(job_id=job_id,
location=self.location).result())
+ if result and len(result) > 0:
+ row = result[0]
Review Comment:
```suggestion
result = bq_hook.get_job(job_id=job_id,
location=self.location).result()
row = next(iter(result), None)
if row is not None:
```
This should be more efficient.
--
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]