airflow.providers.snowflake.triggers.snowflake_trigger¶
Classes¶
Fetch the status for the query ids passed. |
Module Contents¶
- class airflow.providers.snowflake.triggers.snowflake_trigger.SnowflakeSqlApiTrigger(poll_interval, query_ids, snowflake_conn_id, token_life_time, token_renewal_delta, cancel_on_kill=True)[source]¶
Bases:
airflow.triggers.base.BaseTriggerFetch the status for the query ids passed.
- Parameters:
poll_interval (float) – polling period in seconds to check for the status
query_ids (list[str]) – List of Query ids to run and poll for the status
snowflake_conn_id (str) – Reference to Snowflake connection id
token_life_time (datetime.timedelta) – lifetime of the JWT Token in timedelta
token_renewal_delta (datetime.timedelta) – Renewal time of the JWT Token in timedelta
cancel_on_kill (bool) – If True (default), cancel the running Snowflake queries when the user kills the deferred task (mark failed, clear, or mark success). Requires a version of
apache-airflowwithBaseTrigger.on_kill()support; on older versions it is inert.
- async on_kill()[source]¶
Best-effort cancel of the running Snowflake queries when the user kills the deferred task.
Cancellation issues one blocking request per query id, so a task with many statements against a slow warehouse can exceed the triggerer’s
[triggerer] on_kill_timeout(default 30s); statements not cancelled within that budget may keep running.