0
0
Apache Airflowdevops~10 mins

Cron expressions in Airflow - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to schedule a DAG to run every day at midnight using a cron expression.

Apache Airflow
schedule_interval = '[1]'
Drag options to blanks, or click blank then click option'
A0 0 * * *
B0 12 * * *
C* * * * *
D0 0 * * 0
Attempts:
3 left
💡 Hint
Common Mistakes
Using 12 instead of 0 for hour to represent midnight.
Using '*' for hour which means every hour.
2fill in blank
medium

Complete the code to schedule a DAG to run every Monday at 6 AM.

Apache Airflow
schedule_interval = '[1]'
Drag options to blanks, or click blank then click option'
A0 18 * * 1
B0 6 * * 0
C0 6 * * 1
D0 6 1 * *
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 for Monday instead of 1.
Using 18 for hour which means 6 PM instead of 6 AM.
3fill in blank
hard

Fix the error in the cron expression to run a DAG every 15 minutes.

Apache Airflow
schedule_interval = '[1]'
Drag options to blanks, or click blank then click option'
A*/15 * * * *
B15 * * * *
C0/15 * * * *
D0 * * * */15
Attempts:
3 left
💡 Hint
Common Mistakes
Using '15 * * * *' which runs only at minute 15 every hour.
Using '0/15' which is not standard cron syntax.
4fill in blank
hard

Fill both blanks to schedule a DAG to run at 3:30 PM on the 1st day of every month.

Apache Airflow
schedule_interval = '[1] [2] 1 * *'
Drag options to blanks, or click blank then click option'
A30
B15
C3
D0
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping hour and minute fields.
Using 3 instead of 15 for hour which is 3 AM, not 3 PM.
5fill in blank
hard

Fill all three blanks to schedule a DAG to run every weekday at 8:00 AM.

Apache Airflow
schedule_interval = '[1] [2] * * [3]'
Drag options to blanks, or click blank then click option'
A0
B8
C1-5
D0-6
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0-6 for day of week which includes weekends.
Swapping hour and minute fields.