shahar1 commented on code in PR #31457:
URL: https://github.com/apache/airflow/pull/31457#discussion_r1214467704
##########
airflow/providers/google/cloud/hooks/bigquery.py:
##########
@@ -2255,7 +2255,8 @@ def run_query(
job = self.insert_job(configuration=configuration,
project_id=self.project_id, location=location)
self.running_job_id = job.job_id
- return job.job_id
+ job_id = job._properties.get("id", None)
Review Comment:
1. Why return the job ID from another resource instead of the value given by
`job.job_id`? Couldn't it lead to inconsistencies?
2. In what cases is the `id` unset? (`None`)
##########
airflow/providers/google/cloud/operators/bigquery.py:
##########
@@ -116,6 +119,9 @@ def get_link(
if len(job_ids) < self.index:
return None
job_id = job_ids[self.index]
+ # converts project_id:location.job_id to project_id:location:job_id
+ if job_id:
+ job_id = str(job_id).replace(".", ":")
Review Comment:
Instead of repeating this logic twice - I think that it's worth extracting
it to a helper static method in the hook
--
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]