Airflow: Can you put descriptions of the tasks so that they show up in dashboard?

▼魔方 西西 提交于 2020-02-04 18:42:15

问题


I can't seem to find a way to put descriptions about the Airflow tasks so that they show up in the Dashboard. I am reading their documentation but can't find there either. Does anyone know if this is possible?


回答1:


You can document both DAGs and tasks with either doc or doc_<json|yaml|md|rst> fields depending on how you want it formatted. These will show up on the dashboard under "Graph View" for DAGs and "Task Details" for tasks.

Example:

"""
# Foo
Hello, these are DAG docs.
"""

...

dag = DAG(
    'test.foo',
    default_args=default_args,
)
dag.doc_md = __doc__

with dag:
    task1 = DummyOperator(
        task_id='task1',
    )
    task1.doc_md = 'Hi, these are task docs.'

Which will result the following:

This feature is documented in https://airflow.apache.org/concepts.html#documentation-notes.



来源:https://stackoverflow.com/questions/57167688/airflow-can-you-put-descriptions-of-the-tasks-so-that-they-show-up-in-dashboard

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