0
0
Apache Airflowdevops~20 mins

Execution date vs logical date in Apache Airflow - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Execution Date Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Airflow Execution Date

In Apache Airflow, what does the execution date represent?

AThe date and time when the DAG was last modified.
BThe date and time when the task actually runs on the system.
CThe current system date and time when the DAG is triggered manually.
DThe logical date and time for which the DAG run is scheduled, representing the data interval start.
Attempts:
2 left
💡 Hint

Think about what Airflow uses to identify the data period a DAG run is processing.

💻 Command Output
intermediate
1:30remaining
Output of Airflow DAG Run Dates

Given a DAG scheduled to run daily starting at 2024-06-01, if a DAG run starts at 2024-06-02 01:00 AM, what is the execution date shown in the Airflow UI for this run?

A2024-06-01 00:00:00
B2024-06-02 01:00:00
C2024-06-02 00:00:00
D2024-06-03 00:00:00
Attempts:
2 left
💡 Hint

Remember that execution date points to the start of the data interval, not the actual run time.

🔀 Workflow
advanced
2:00remaining
Airflow Logical Date vs Execution Date in Backfill

You run an Airflow backfill command for a DAG with daily schedule from 2024-05-28 to 2024-05-30. Which dates will be used as execution dates for the backfill runs?

A2024-05-29, 2024-05-30, 2024-05-31
B2024-05-28, 2024-05-29, 2024-05-30
C2024-05-27, 2024-05-28, 2024-05-29
D2024-05-30, 2024-05-31, 2024-06-01
Attempts:
2 left
💡 Hint

Execution dates correspond to the logical schedule dates you specify for backfill.

Troubleshoot
advanced
2:00remaining
Troubleshooting Unexpected Execution Date in Airflow

You notice that a DAG run triggered manually shows an execution date of 2024-06-01 00:00:00, even though you triggered it on 2024-06-05. Why does this happen?

AManual triggers always use the current system date as execution date.
BThe DAG schedule interval is ignored for manual triggers, so execution date is random.
CManual triggers use the logical execution date you specify or default to the previous scheduled interval start.
DAirflow has a bug causing execution dates to not update on manual triggers.
Attempts:
2 left
💡 Hint

Think about how Airflow assigns execution dates for manual runs.

Best Practice
expert
2:30remaining
Best Practice for Using Execution Date in Airflow Tasks

Which is the best practice for using the execution date inside an Airflow task to process data?

AUse the execution date as the start of the data interval and calculate the end date by adding the schedule interval.
BUse the current system date and time to process data, ignoring the execution date.
CUse the execution date as the exact timestamp to fetch data only for that second.
DUse a fixed date hardcoded in the DAG to avoid confusion.
Attempts:
2 left
💡 Hint

Think about how to define the data interval for processing in scheduled DAGs.