Veldhoen commented on issue #53640:
URL: https://github.com/apache/airflow/issues/53640#issuecomment-3224042461

   My goal was to make the trigger succeed/fail the task directly, so raise a 
`TaskSuccessEvent` or `TaskFailureEvent` instead of a `TriggerEvent`:
   
   Using 
   ```
   from airflow.triggers.base import (
       BaseTrigger,
       TriggerEvent,
       TaskFailedEvent,
       TaskSuccessEvent,
   )
   ```
   
   And in the CustomTrigger definition: 
   ```
   async def run(self):
           self.log.info("CustomTrigger is running.")
           await asyncio.sleep(2)
           yield TaskSuccessEvent(xcoms={"message": "Trigger fired 
successfully."})
   ```
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to