Skip to content

Commit

Permalink
Add poll_interval param in BigQueryInsertJobOperator (#30091)
Browse files Browse the repository at this point in the history
* Add poll_interval param in BigQueryInsertJobOperator

* Apply review suggestion
  • Loading branch information
pankajastro authored Mar 15, 2023
1 parent 63d9266 commit a671580
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions airflow/providers/google/cloud/operators/bigquery.py
Original file line number Diff line number Diff line change
Expand Up @@ -2630,6 +2630,7 @@ class BigQueryInsertJobOperator(GoogleCloudBaseOperator):
:param result_retry: How to retry the `result` call that retrieves rows
:param result_timeout: The number of seconds to wait for `result` method before using `result_retry`
:param deferrable: Run operator in the deferrable mode
:param poll_interval: polling period in seconds to check for the status of job. Defaults to 4 seconds.
"""

template_fields: Sequence[str] = (
Expand Down Expand Up @@ -2660,6 +2661,7 @@ def __init__(
result_retry: Retry = DEFAULT_RETRY,
result_timeout: float | None = None,
deferrable: bool = False,
poll_interval: float = 4.0,
delegate_to: str | None = None,
**kwargs,
) -> None:
Expand All @@ -2682,6 +2684,7 @@ def __init__(
self.result_timeout = result_timeout
self.hook: BigQueryHook | None = None
self.deferrable = deferrable
self.poll_interval = poll_interval

def prepare_template(self) -> None:
# If .json is passed then we have to read the file
Expand Down Expand Up @@ -2789,6 +2792,7 @@ def execute(self, context: Any):
conn_id=self.gcp_conn_id,
job_id=self.job_id,
project_id=self.project_id,
poll_interval=self.poll_interval,
),
method_name="execute_complete",
)
Expand Down

0 comments on commit a671580

Please sign in to comment.