airflow.providers.celery.sensors.celery_queue

Module Contents

class airflow.providers.celery.sensors.celery_queue.CeleryQueueSensor(*, celery_queue: str, target_task_id: Optional[str] = None, **kwargs)[source]

Bases: airflow.sensors.base.BaseSensorOperator

Waits for a Celery queue to be empty. By default, in order to be considered empty, the queue must not have any tasks in the reserved, scheduled or active states.

Parameters
  • celery_queue (str) -- The name of the Celery queue to wait for.

  • target_task_id (str) -- Task id for checking

_check_task_id(self, context: Dict[str, Any])[source]

Gets the returned Celery result from the Airflow task ID provided to the sensor, and returns True if the celery result has been finished execution.

Parameters

context (dict) -- Airflow's execution context

Returns

True if task has been executed, otherwise False

Return type

bool

poke(self, context: Dict[str, Any])[source]

Was this entry helpful?