如何获取所有任务的列表及其在气流中运行的当前DAG的状态
需要帮助,以提取所有任务的列表以及当前DAG运行的当前状态[成功/失败]。 我有一个Python操作员的任务,该操作员在工作流程结束时执行。此任务的责任是返回以状态执行的任务。
Need help to extract the list of all tasks along with their current status [Success/Failed] for the current dag run.
I have a task with a python operator which executes at the end of the workflow. The responsibility of this task is to return the no of tasks executed with the status.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以创建一个pythOnoperator,该操作员从DAG_RUN读取所有任务。
task_id =“ tasks”的XCOM是:
You can create a PythonOperator that read all tasks from the dag_run.
The xcom of task_id="tasks" is :
您可以使用气流API提取有关工作流的信息。您可以读取REST API文档在这里。例如,要列出特定dag的所有DAG运行:
之后,您可以列出此特定DAG运行的所有任务:
in airflow UI>>文档>> REST API参考(Swagger UI)您可以使用Swagger文档访问和测试API。
You can use Airflow API to extract information about your workflows. You can read the Rest API documentation here. For instance, to list all DAG runs for a specific DAG:
After, you can list all tasks for this specific DAG Run:
In Airflow UI >> Docs >> REST API Reference (Swagger UI) you can access and test the API using Swagger documentation.