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

   OK @uranusjr @ephraimbuddy @jedcunningham  the scope of this PR expanded a 
little bit.
   I wanted to add validation so that (1) a task can't be both setup and 
teardown, (2) once you set a task to be teardown, you can't change it to be 
setup or vice versa, (3) for mapped operator, explicitly forbid users from 
setting is_teardown or is_setup or on_failure_fail_dagrun, and (4) forbid user 
from setting `on_failure_fail_dagrun` unless the task is a teardown task.
   
   Clamping down a little more in this way should make the feature a little 
more user friendly by preventing some usages / configurations that don't make 
sense or are in any case unsupported.
   
   To accomplish this I changed the three attrs to be properties.  I added them 
to abstractoperator and I override the setter in mappedoperator to throw an 
error.
   
   The reason it made sense in abstract operator instead of baseoperator is 
that in taskflow / xcomarg the iter_references method yields type `Operator` 
which is either base or mapped operator which both inherit separately from 
abstractoperator.
   
   So when implementing as_teardown etc for taskflow, we can just set the attrs 
without inspecting type and let mapped operator throw when it's not supported.
   
   Ready for a look now.  Thank you.


-- 
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: commits-unsubscr...@airflow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to