Airflow deferred operator example: Where are BaseTrigger and TriggerEvent from?

Viewed 268

I am attempting to try using Deferrable opertators however, the example seem to be lacking info on where BaseTrigger and TriggerEvent are imported from. I cant seem to find info on the docs too

https://airflow.apache.org/docs/apache-airflow/stable/concepts/deferring.html?highlight=triggerevent


    def __init__(self, moment):
        super().__init__()
        self.moment = moment

    def serialize(self):
        return ("airflow.triggers.temporal.DateTimeTrigger", {"moment": self.moment})

    async def run(self):
        while self.moment > timezone.utcnow():
            await asyncio.sleep(1)
        yield TriggerEvent(self.moment)
1 Answers

BaseTrigger is located in airflow.triggers.base.BaseTrigger and TriggerEvent is located in airflow.triggers.base.TriggerEvent.

An IDE such as PyCharm is very helpful in finding such things: press double shift and search BaseTrigger will get you to module directly.

Related