我想在 vs 代码中使用 python 测试 airflow dags。 任务是从 python 测试运行/触发 dag 并验证其输出并显示测试结果。 有人知道吗?
从其他 python 文件触发气流 dag 的命令是什么
找到类似问题的答案。下面给出的链接如何从 Python 脚本中触发 airflow DAG 运行? 在触发 Airflow DAG 运行时,您有多种选择。使用 Python airflow python 包提供了一个本地客户端,您可以使用它从 python 脚本中触发 dag。例如: from airflow.api.client.local_client import Client c = Client(None, None) c.trigger_dag(dag_id='test_dag_id', run_id='test_run_id', conf={})
如果有人知道任何其他方法来做同样的事情,如果您提出建议将会有所帮助。