airflow-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Wang, Larry" <Larry.L.W...@dell.com>
Subject RE: Qs on airflow
Date Tue, 10 Oct 2017 13:43:27 GMT
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

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message