0

I created a DAG with airflow 2 Taskflow API:

with airflow.DAG("plot", schedule_interval=None, default_args=default_args) as dag:
    cf = collect_files()
    upi = update_process_info(cf)
    for i in range(0, max_parallel_plot_tasks):
        plot_files(cf, i, int(max_parallel_plot_tasks)) >> upi

How I get rid of the connection of "collect_files" to "update_process_info" with the Taskflow API?

Graph:

Graph

Regards Oli

opfau
  • 731
  • 9
  • 37

1 Answers1

1

Try something like:

with airflow.DAG("plot", schedule_interval=None, default_args=default_args) as dag:
    cf = collect_files()
    upi = None
    for i in range(0, max_parallel_plot_tasks):
        if not upi:
            upi = update_process_info(plot_files(cf, i, int(max_parallel_plot_tasks)))
        else:
            plot_files(cf, i, int(max_parallel_plot_tasks)) >> upi
white91wolf
  • 400
  • 4
  • 18