问题
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