def dag_state(args):
 dag = get_dag(args)
 dr = DagRun.find(dag.dag_id, execution_date=args.execution_date)
 print((dr[0].state if (len(dr) > 0) else None))

def dag_state ( args ) : dag = get_dag ( args ) dr = DagRun . find ( dag . dag_id , execution_date = args . execution_date ) print ( ( dr [ 0 ] . state if ( len ( dr ) > 0 ) else None ) )
returns the state of a dagrun at the command line .