airflow.providers.databricks.triggers.genie¶
Triggers for Databricks Genie conversations.
Classes¶
Wait for a Genie message to reach a terminal status. |
Module Contents¶
- class airflow.providers.databricks.triggers.genie.DatabricksGenieMessageTrigger(*, space_id, conversation_id, message_id, databricks_conn_id='databricks_default', polling_period_seconds=5, retry_limit=3, retry_delay=1)[source]¶
Bases:
airflow.triggers.base.BaseTriggerWait for a Genie message to reach a terminal status.
The trigger only reads the message status. The worker fetches the answer and query results when the task resumes, so the trigger event never carries Genie output or credentials.
- Parameters:
space_id (str) – Genie space ID.
conversation_id (str) – Genie conversation ID.
message_id (str) – Genie message ID to poll.
databricks_conn_id (str) – Databricks connection. Defaults to
databricks_default.polling_period_seconds (float) – Seconds between status checks. Defaults to
5.retry_limit (int) – Attempts for each status read. Defaults to
3.retry_delay (float) – Minimum seconds between read attempts. Defaults to
1.
- 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.