Skip to content

Commit

Permalink
style(providers/google): improve BigQueryInsertJobOperator type hinti…
Browse files Browse the repository at this point in the history
…ng (#36894)

* style(providers/google): improve BigQueryInsertJobOperator type hinting

* style: resolve mypy failure
  • Loading branch information
Lee-W committed Jan 20, 2024
1 parent 6e7085b commit 09bb1a8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2852,6 +2852,7 @@ def execute(self, context: Any):
persist_kwargs["dataset_id"] = table["datasetId"]
persist_kwargs["project_id"] = table["projectId"]
BigQueryTableLink.persist(**persist_kwargs)

self.job_id = job.job_id

if self.project_id:
Expand All @@ -2861,6 +2862,7 @@ def execute(self, context: Any):
location=self.location,
)
context["ti"].xcom_push(key="job_id_path", value=job_id_path)

# Wait for the job to complete
if not self.deferrable:
job.result(timeout=self.result_timeout, retry=self.result_retry)
Expand All @@ -2882,7 +2884,7 @@ def execute(self, context: Any):
self.log.info("Current state of job %s is %s", job.job_id, job.state)
self._handle_job_error(job)

def execute_complete(self, context: Context, event: dict[str, Any]):
def execute_complete(self, context: Context, event: dict[str, Any]) -> str | None:
"""Callback for when the trigger fires.
This returns immediately. It relies on trigger to throw an exception,
Expand Down

0 comments on commit 09bb1a8

Please sign in to comment.