Defining a task SLA
After completing the SLA on the entire workflow, you realize you really only need the SLA timing on a specific task instead of the full workflow.
The appropriate Airflow libraries are imported for you.
Deze oefening maakt deel uit van de cursus
Introduction to Apache Airflow in Python
Oefeninstructies
- Import the
timedeltaobject. - Add a 3 hour
slato the task.
Praktische interactieve oefening
Probeer deze oefening eens door deze voorbeeldcode in te vullen.
# Import the timedelta object
____
test_dag = DAG('test_workflow', start_date=datetime(2024,1,20), schedule_interval=None)
# Create the task with the SLA
task1 = BashOperator(task_id='first_task',
____=____,
bash_command='initialize_data.sh',
dag=test_dag)