airflow的参数

来源[https://airflow.apache.org/code.html?highlight=ds_nodash#api-reference](https://airflow.apache.org/code.html?highlight=ds_nodash#api-reference)

Default Variables

Variable Description
{{ ds }} the execution date as YYYY-MM-DD
{{ ds_nodash }} the execution date as YYYYMMDD
{{ yesterday_ds }} yesterday’s date as YYYY-MM-DD
{{ yesterday_ds_nodash }} yesterday’s date as YYYYMMDD
{{ tomorrow_ds }} tomorrow’s date as YYYY-MM-DD
{{ tomorrow_ds_nodash }} tomorrow’s date as YYYYMMDD
{{ ts }} same as execution_date.isoformat()
{{ ts_nodash }} same as ts without - and :
{{ execution_date }} the execution_date, (datetime.datetime)
{{ prev_execution_date }} the previous execution date (if available) (datetime.datetime)
{{ next_execution_date }} the next execution date (datetime.datetime)
{{ dag }} the DAG object
{{ task }} the Task object
{{ macros }} a reference to the macros package, described below
{{ task_instance }} the task_instance object
{{ end_date }} same as {{ ds }}
{{ latest_date }} same as {{ ds }}
{{ ti }} same as {{ task_instance }}
{{ params }} a reference to the user-defined params dictionary
{{ var.value.my_var }} global defined variables represented as a dictionary

{{ var.json.my_var.path }}

global defined variables represented as a dictionary with deserialized JSON object, append the path to the key within the JSON object

{{ task_instance_key_str }}

a unique, human-readable key to the task instance formatted {dag_id}_{task_id}_{ds}

{{ conf }}

the full configuration object located at airflow.configuration.conf which represents the content of your airflow.cfg

{{ run_id }} the run_id of the current DAG run
{{ dag_run }} a reference to the DagRun object

{{ test_mode }}

whether the task instance was called using the CLI’s test subcommand

Macros

Variable Description
macros.datetime The standard lib’s datetime.datetime
macros.timedelta

The standard lib’s datetime.timedelta

macros.dateutil A reference to the dateutil package
macros.time The standard lib’s time
macros.uuid The standard lib’s uuid
macros.random The standard lib’s random

猜你喜欢

转载自blog.csdn.net/hunter_yang_Tuziki/article/details/79745951