:py:mod:`astronomer.providers.core.triggers.external_task` ========================================================== .. py:module:: astronomer.providers.core.triggers.external_task Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: astronomer.providers.core.triggers.external_task.TaskStateTrigger astronomer.providers.core.triggers.external_task.DagStateTrigger .. py:class:: TaskStateTrigger(dag_id, task_id, states, execution_dates, poll_interval = 5.0) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` Waits asynchronously for a task in a different DAG to complete for a specific logical date. :param dag_id: The dag_id that contains the task you want to wait for :param task_id: The task_id that contains the task you want to wait for. If ``None`` (default value) the sensor waits for the DAG :param states: allowed states, default is ``['success']`` :param execution_dates: :param poll_interval: The time interval in seconds to check the state. The default value is 5 sec. .. py:method:: serialize(self) Serializes TaskStateTrigger arguments and classpath. .. py:method:: run(self) :async: Checks periodically in the database to see if the task exists, and has hit one of the states yet, or not. .. py:method:: count_tasks(self, session) Count how many task instances in the database match our criteria. .. py:class:: DagStateTrigger(dag_id, states, execution_dates, poll_interval = 5.0) Bases: :py:obj:`airflow.triggers.base.BaseTrigger` Waits asynchronously for a task in a different DAG to complete for a specific logical date. :param dag_id: The dag_id that contains the task you want to wait for :param task_id: The task_id that contains the task you want to wait for. If ``None`` (default value) the sensor waits for the DAG :param states: allowed states, default is ``['success']`` :param execution_dates: The logical date at which DAG run. :param poll_interval: The time interval in seconds to check the state. The default value is 5.0 sec. .. py:method:: serialize(self) Serializes DagStateTrigger arguments and classpath. .. py:method:: run(self) :async: Checks periodically in the database to see if the dag run exists, and has hit one of the states yet, or not. .. py:method:: count_dags(self, session) Count how many dag runs in the database match our criteria.