當前位置: 首頁>>代碼示例>>Python>>正文


Python BashOperator.doc_md方法代碼示例

本文整理匯總了Python中airflow.operators.bash_operator.BashOperator.doc_md方法的典型用法代碼示例。如果您正苦於以下問題:Python BashOperator.doc_md方法的具體用法?Python BashOperator.doc_md怎麽用?Python BashOperator.doc_md使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在airflow.operators.bash_operator.BashOperator的用法示例。


在下文中一共展示了BashOperator.doc_md方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: DAG

# 需要導入模塊: from airflow.operators.bash_operator import BashOperator [as 別名]
# 或者: from airflow.operators.bash_operator.BashOperator import doc_md [as 別名]
    # 'trigger_rule': u'all_success'
}

dag = DAG(
    'tutorial',
    default_args=default_args,
    description='A simple tutorial DAG',
    schedule_interval=timedelta(days=1))

# t1, t2 and t3 are examples of tasks created by instantiating operators
t1 = BashOperator(
    task_id='print_date',
    bash_command='date',
    dag=dag)

t1.doc_md = """\
#### Task Documentation
You can document your task using the attributes `doc_md` (markdown),
`doc` (plain text), `doc_rst`, `doc_json`, `doc_yaml` which gets
rendered in the UI's Task Instance Details page.
![img](http://montcs.bloomu.edu/~bobmon/Semesters/2012-01/491/import%20soul.png)
"""

dag.doc_md = __doc__

t2 = BashOperator(
    task_id='sleep',
    depends_on_past=False,
    bash_command='sleep 5',
    dag=dag)
開發者ID:owlabs,項目名稱:incubator-airflow,代碼行數:32,代碼來源:tutorial.py

示例2: BashOperator

# 需要導入模塊: from airflow.operators.bash_operator import BashOperator [as 別名]
# 或者: from airflow.operators.bash_operator.BashOperator import doc_md [as 別名]
My numbered list:

1. one
1. two

My bulleted list:

- first
- second
"""

the_task = BashOperator(
    task_id='the_task',
    bash_command='echo THE_TASK',
    dag=dag)
the_task.doc_md = """\
# Title
Here's a [url](www.airbnb.com)

My list:

1. one
1. two

My bulleted list:

- first
- second
"""
開發者ID:Aleks-Ya,項目名稱:yaal_examples,代碼行數:31,代碼來源:description_markdown.py


注:本文中的airflow.operators.bash_operator.BashOperator.doc_md方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。