Airflow TaskFlow: Difference between revisions
Jump to navigation
Jump to search
Line 16: | Line 16: | ||
def some_dag(): | def some_dag(): | ||
@task | @task | ||
def task_a(): | def task_a(ti=None): | ||
print(" | print(f"executing task A, task instance {ti}") | ||
@task | @task | ||
def task_b(): | def task_b(ti=None): | ||
print(" | print(f"executing task B, task instance {ti}") | ||
task_a() >> task_b() | task_a() >> task_b() |
Revision as of 02:53, 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(ti=None):
print(f"executing task A, task instance {ti}")
@task
def task_b(ti=None):
print(f"executing task B, task instance {ti}")
task_a() >> task_b()