Airflow TaskFlow: Difference between revisions
Jump to navigation
Jump to search
Line 6: | Line 6: | ||
=Overview= | =Overview= | ||
=Programming Model= | =Programming Model= | ||
<syntaxhighlight lang='py'> | |||
from airflow.decorators import dag, task | |||
from datetime import datetime | |||
@dag( | |||
[...] | |||
) | |||
def some_dag(): | |||
@task | |||
def task_a(): | |||
print(">>> A") | |||
@task | |||
def task_b(): | |||
print(">>> B") | |||
task_a() >> task_b() | |||
</syntaxhighlight> | |||
=Context= | =Context= |
Revision as of 02:50, 16 July 2022
External
- https://airflow.apache.org/docs/apache-airflow/stable/concepts/taskflow.html
- https://airflow.apache.org/docs/apache-airflow/stable/tutorial_taskflow_api.html
Internal
Overview
Programming Model
from airflow.decorators import dag, task
from datetime import datetime
@dag(
[...]
)
def some_dag():
@task
def task_a():
print(">>> A")
@task
def task_b():
print(">>> B")
task_a() >> task_b()