OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Can a DAG be conditionally hidden from the UI?


Hi all,

tl;dr - Is it possible to conditionally hide a DAG from the UI based on an
environment variable?



Our team has a single repo with several DAGs in it and we deploy it across
multiple 'environments' (think dev, test, and other integration
environments).  While most DAGs are meant to run everywhere, we do have
several which are meant to run in one and only one environment.  Of course
they are all paused, but it would be nice to declutter a bit for ourselves.

My question then - is it possible to conditionally hide a DAG from the UI
based on an environment variable or some flag somewhere.

This is just wishful thinking - the dev could do something like

dag = get_dag(...),and get_dag() would have a decorator like
@only_run_in("integration4,dev,local")

And that decorator returns some kind of None object or special DAG which
just doesn't appear in the list.

Or perhaps some other way to accomplish this same effect - any ideas would
be appreciated.

Thanks