Define order of Tasks
Now that you've learned about the bitshift syntax, it's time to define the task ordering. You have three currently defined tasks, cleanup, consolidate, and push_data.
The dag and task decorators from airflow.sdk are already imported.
Bu egzersiz
Python ile Apache Airflow'a Giriş
kursunun bir parçasıdırEgzersiz talimatları
- Configure the
cleanuptask to run first before theconsolidatetask, using the bitshift syntax. - Configure
consolidateto run next and thepush_datatask to run last.
Uygulamalı interaktif egzersiz
Bu örnek kodu tamamlayarak bu egzersizi bitirin.
@dag(
dag_id="analytics_dag",
start_date=datetime(2026, 3, 1),
)
def analytics_dag():
# Run cleanup before consolidate
cleanup() ____ consolidate()
# Run consolidate before push_data
____
analytics_dag()