BaşlayınÜcretsiz Başlayın

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ır
Kursu Görüntüle

Egzersiz talimatları

  • Configure the cleanup task to run first before the consolidate task, using the bitshift syntax.
  • Configure consolidate to run next and the push_data task 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()
Kodu Düzenle ve Çalıştır