astronomer.providers.core.sensors.astro

Module Contents

Classes

ExternalDeploymentSensor

Custom Apache Airflow sensor for monitoring external deployments using Astro Cloud.

class astronomer.providers.core.sensors.astro.ExternalDeploymentSensor(external_dag_id, astro_cloud_conn_id='astro_cloud_default', external_task_id=None, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

Custom Apache Airflow sensor for monitoring external deployments using Astro Cloud.

Parameters:
  • external_dag_id (str) – External ID of the DAG being monitored.

  • astro_cloud_conn_id (str) – The connection ID to retrieve Astro Cloud credentials. Defaults to “astro_cloud_default”.

  • external_task_id (str | None) – External ID of the task being monitored. If None, monitors the entire DAG.

  • kwargs (Any) – Additional keyword arguments passed to the BaseSensorOperator constructor.

poke(context)[source]

Check the status of a DAG/task in another deployment.

Queries Airflow’s REST API for the status of the specified DAG or task instance. Returns True if successful, False otherwise.

Parameters:

context (astronomer.providers.utils.typing_compat.Context) – The task execution context.

execute(context)[source]

Executes the sensor.

If the external deployment is not successful, it defers the execution using an AstroDeploymentTrigger.

Parameters:

context (astronomer.providers.utils.typing_compat.Context) – The task execution context.

execute_complete(context, event)[source]

Handles the completion event from the deferred execution.

Raises AirflowSkipException if the upstream job failed and soft_fail is True. Otherwise, raises AirflowException.

Parameters: