uranusjr commented on pull request #17545:
URL: https://github.com/apache/airflow/pull/17545#issuecomment-896650500


   > I think also we already can influence the flow with `pre_execute` just a 
few lines above - and you already can throw any exception there and it will be 
synchronous and will impact the flow.
   
   One thing I observed from some recent discussions on operators (including 
this one) is, the operator actually support a lot of hooking mechanism if you 
are willing to subclass them, but maybe users are either unaware of the 
possibility, or (rationally or not) resisting doing so. If it’s the former, 
maybe we should push the idea more (but that’s not easy since inheritance hurts 
discoverability by its very nature).
   
   Perhaps one possibility is to have `pre_execute_hook` etc. arguments on the 
operator’s `__init__` so users can directly pass a callable to it to avoid 
subclassing. But the operator classes’ argument list is already quite unwieldy 
so I’m not sure that’s a good idea either (and it’ll be difficult to explain 
how those hooks are different from `on_execute_callback` as well).


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