I am using Airflow 2.4.0.
from airflow.decorators import task
from airflow import DAG
with DAG(
"hello_world",
start_date=datetime(2022, 1, 1),
schedule_interval="@daily",
catchup=False,
) as dag:
@task()
def get_name():
return {
'first_name': 'Hongbo',
'last_name': 'Miao',
}
get_name()
Currently I am using @task()
. Based on the document https://airflow.apache.org/docs/apache-airflow/stable/tutorial/taskflow.html, it seems I can also use
@task(multiple_outputs=True)
@task(retries=3)
@task(task_id="get_name")
However, it does not include the explanation.
When I use multiple_outputs=True
or multiple_outputs=False
, or not it, the task still runs well. So I am wondering what is the purposes of it.
Is there a document listing all parameters for @task
decorator that I can use and their actual functions? Thanks!