You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@airflow.apache.org by "Wang, Larry" <La...@dell.com> on 2017/10/10 13:43:27 UTC
RE: Qs on airflow
Hi Airflow experts,
I am trying to set a branch operator which will be executed another one branch at a time in one Dag, the codes looks like this,
bbt_migrate_vm = DummyOperator()
bbt_migrate_vm_back = DummyOperator()
def migrate_choice():
is_even = Variable.get("is_even")
if is_even == "True":
Variable.set("is_even", "False")
return "bbt_migrate_vm_back"
else:
Variable.set("is_even", "True")
return "bbt_migrate_vm"
But the problem is, I still need to check the previous status of the last iteration, say for example, when I execute bbt_migrate_vm_back, I need to check the status of previous bbt_might_vm in last run is pass, how should I achieve that?
Larry