Get startedGet started for free

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.

This exercise is part of the course

Introduction to Apache Airflow in Python

View Course

Exercise instructions

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

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

@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()
Edit and Run Code