Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2247,16 +2247,13 @@ def _submit_job(
hook: BigQueryHook,
job_id: str,
) -> BigQueryJob:
# Submit a new job
job = hook.insert_job(
# Submit a new job and wait for it to complete and get the result.
return hook.insert_job(
configuration=self.configuration,
project_id=self.project_id,
location=self.location,
job_id=job_id,
)
# Start the job and wait for it to complete and get the result.
job.result()
return job

@staticmethod
def _handle_job_error(job: BigQueryJob) -> None:
Expand Down
2 changes: 1 addition & 1 deletion tests/providers/google/cloud/operators/test_bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -930,7 +930,7 @@ def test_execute_reattach(self, mock_hook, mock_md5):
}
}

mock_hook.return_value.insert_job.return_value.result.side_effect = Conflict("any")
mock_hook.return_value.insert_job.side_effect = Conflict("any")
job = MagicMock(
job_id=real_job_id,
error_result=False,
Expand Down