Complete the code to print the logical date of an Airflow task instance.
print(ti.[1])
The logical_date attribute represents the scheduled date for the task instance, which is different from the actual execution time.
Complete the code to get the execution date from the context dictionary in an Airflow operator.
exec_date = context.get('[1]')
The execution_date key in the context dictionary holds the actual execution time of the task instance.
Fix the error in the code to correctly compare execution date and logical date.
if ti.execution_date == ti.[1]: print('Dates match')
The logical_date attribute should be used to compare with execution_date because it represents the scheduled run date.
Fill both blanks to create a dictionary comprehension that maps logical dates to execution dates for task instances.
{ti.[1]: ti.[2] for ti in task_instances}This comprehension creates a dictionary where keys are logical dates and values are execution dates of task instances.
Fill all three blanks to filter task instances where execution date is after logical date and create a dictionary with logical date keys and execution date values.
{ti.[1]: ti.[2] for ti in task_instances if ti.[3] > ti.[1]The dictionary comprehension filters task instances where the execution date is later than the logical date, mapping logical dates to execution dates.