LoslegenKostenlos loslegen

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.

Diese Übung ist Teil des Kurses

Einführung in Apache Airflow mit Python

Kurs anzeigen

Anleitung zur Übung

  • 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.

Interaktive Übung

Vervollständige den Beispielcode, um diese Übung erfolgreich abzuschließen.

@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()
Code bearbeiten und ausführen