本文整理汇总了Python中airflow.DAG.doc_md方法的典型用法代码示例。如果您正苦于以下问题:Python DAG.doc_md方法的具体用法?Python DAG.doc_md怎么用?Python DAG.doc_md使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类airflow.DAG
的用法示例。
在下文中一共展示了DAG.doc_md方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: timedelta
# 需要导入模块: from airflow import DAG [as 别名]
# 或者: from airflow.DAG import doc_md [as 别名]
from airflow.sensors.http_sensor import HttpSensor
default_args = {
'owner': 'airflow',
'depends_on_past': False,
'start_date': airflow.utils.dates.days_ago(2),
'email': ['[email protected]'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG('example_http_operator', default_args=default_args)
dag.doc_md = __doc__
# t1, t2 and t3 are examples of tasks created by instantiating operators
t1 = SimpleHttpOperator(
task_id='post_op',
endpoint='api/v1.0/nodes',
data=json.dumps({"priority": 5}),
headers={"Content-Type": "application/json"},
response_check=lambda response: True if len(response.json()) == 0 else False,
dag=dag)
t5 = SimpleHttpOperator(
task_id='post_op_formenc',
endpoint='nodes/url',
data="name=Joe",
headers={"Content-Type": "application/x-www-form-urlencoded"},
示例2: DAG
# 需要导入模块: from airflow import DAG [as 别名]
# 或者: from airflow.DAG import doc_md [as 别名]
Add a Markdown description to a DAG or a task.
The description is shown in “Graph View” for DAGs, “Task Details” for tasks.
Doc: https://airflow.readthedocs.io/en/latest/concepts.html#documentation-notes
"""
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime
default_args = {
'start_date': datetime.now()
}
dag = DAG(
'description_markdown',
default_args=default_args)
dag.doc_md = """
# Markdown hi
## Subheader
Here's a [url](www.airbnb.com)
My numbered list:
1. one
1. two
My bulleted list:
- first
- second
"""