GitHub user potiuk added a comment to the discussion: Setup/teardown doesn't 
work properly when setup task is skipped by branching

Why can't you just add if in your operator and simply "complete". 

Logically speaking "Setup" and "Teardown" should ALWAYS execute. No matter if 
they are doing somethign or not. It's your choice to decide what setup or 
teardown do ( or not do) but the very basic assumption here is that they MUST 
complete suceessfully. Not fail, not skip, they MUST succeed. 

It's like in unit tests. You might want to skip the whole test (including their 
setup and teardown, or decide - in your setup  and teardown that you do not do 
any setup or teardown, yet you do not change the status of setup or teardown 
call - they both should succeed - even if they do NOTHNG (which you can very 
easily do by an if that should not do stuff if it is run in environment where 
setting things up should not be done).. 

Converting to a discusion. There is no good reason to complicate setup / 
teardown to include addional rules here.

GitHub link: 
https://github.com/apache/airflow/discussions/48991#discussioncomment-12774155

----
This is an automatically sent email for [email protected].
To unsubscribe, please send an email to: [email protected]

Reply via email to