How to nest an Airflow DAG dynamically?

流过昼夜 提交于 2019-11-30 22:18:21

See a similar (but different) question here

Basically, you can't add tasks to a DAG when it's running. You would need to know ahead of time how many tasks you wanted to add.

You could process N files using a single operator.

Or, if you have another separate dag that processes a file you could trigger that DAG N times, passing the name of the file in the conf.

See here for an example of the TriggerDagRunOperator.

See here for the DAG that would be triggered.

And lastly see this post from which the above examples are from.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!