dstandish commented on PR #31987:
URL: https://github.com/apache/airflow/pull/31987#issuecomment-1670120154

   > We can definitely support both pretty trivially. The simplest way would be 
to just call `run` and check if the return value is a TriggerEvent (if not, 
`run` is a generator, not a plain function). We can change the docs so most 
people use the plain function variant.
   
   Not important, but I don't think we can do exactly this.  If we call run, 
the return value is either coroutine or asynciterator.  If it's coroutine we 
can await it and obtain the return.  If it is asynciterator, we cannot await it 
but must iterate it.  So I think we could must either try-await-except-iterate, 
or inspect the object type and handle appropriately.  
   
   Either way, I am OK with evolving the interface to support return and update 
the docs as you suggested.  
   
   But I guess it remains for us to decide whether to deprecate iterator, and 
if given iterator, whether to consume up to the return, or just stop at first 
event, or consume all events....


-- 
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