airflow.providers.databricks.triggers.agent

Triggers for Databricks agent invocations.

Classes

DatabricksAgentInvocationTrigger

Wait for an agent invocation to complete, fail or request human input.

Module Contents

class airflow.providers.databricks.triggers.agent.DatabricksAgentInvocationTrigger(*, app_url, invocation_id, databricks_conn_id='databricks_default', session_id=None, polling_period_seconds=10)[source]

Bases: airflow.triggers.base.BaseTrigger

Wait for an agent invocation to complete, fail or request human input.

Parameters:
  • app_url (str) – HTTPS base URL of the deployed app.

  • invocation_id (str) – UUID identifying the invocation to poll.

  • databricks_conn_id (str) – Databricks connection using service principal OAuth or OAuth token federation. Defaults to databricks_default.

  • session_id (str | None) – Conversation ID sent as the routing key. Defaults to None.

  • polling_period_seconds (float) – Seconds between status checks. Defaults to 10.

app_url[source]
invocation_id[source]
databricks_conn_id = 'databricks_default'[source]
session_id = None[source]
polling_period_seconds = 10[source]
serialize()[source]

Return the information needed to reconstruct this Trigger.

Returns:

Tuple of (class path, keyword arguments needed to re-instantiate).

Return type:

tuple[str, dict[str, Any]]

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.

Was this entry helpful?