airflow.providers.amazon.aws.triggers.redshift_data¶
Classes¶
RedshiftDataTrigger is fired as deferred class with params to run the task in triggerer. |
Module Contents¶
- class airflow.providers.amazon.aws.triggers.redshift_data.RedshiftDataTrigger(statement_id, task_id, poll_interval, aws_conn_id='aws_default', region_name=None, verify=None, botocore_config=None, cancel_on_kill=True)[source]¶
Bases:
airflow.triggers.base.BaseTriggerRedshiftDataTrigger is fired as deferred class with params to run the task in triggerer.
- Parameters:
statement_id (str) – the UUID of the statement
task_id (str) – task ID of the Dag
poll_interval (int) – polling period in seconds to check for the status
aws_conn_id (str | None) – AWS connection ID for redshift
region_name (str | None) – aws region to use
cancel_on_kill (bool) – If True (default), cancel the running Redshift statement 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]¶
Cancel the running Redshift statement when the user kills the deferred task.
- async run()[source]¶
Run the trigger in an asynchronous context.
The trigger should yield an Event whenever it wants to fire off an event, and return None if it is finished. Single-event triggers should thus yield and then immediately return.
If it yields, it is likely that it will be resumed very quickly, but it may not be (e.g. if the workload is being moved to another triggerer process, or a multi-event trigger was being used for a single-event task defer).
In either case, Trigger classes should assume they will be persisted, and then rely on cleanup() being called when they are no longer needed.