Aan de slagGa gratis aan de slag

Defining an SLA

You've successfully implemented several Airflow workflows into production, but you don't currently have any method of determining if a workflow takes too long to run. After consulting with your manager and your team, you decide to implement an SLA at the DAG level on a test workflow.

All appropriate Airflow libraries have been imported for you.

Deze oefening maakt deel uit van de cursus

Introduction to Apache Airflow in Python

Cursus bekijken

Oefeninstructies

  • Import the timedelta object.
  • Define a sla of 30 minutes.
  • Add the SLA to the DAG.

Praktische interactieve oefening

Probeer deze oefening eens door deze voorbeeldcode in te vullen.

# Import the timedelta object
____

# Create the dictionary entry
default_args = {
  'start_date': datetime(2024, 1, 20),
  '____': ____
}

# Add to the DAG
test_dag = DAG('test_workflow', default_args=____, schedule_interval=None)
Code bewerken en uitvoeren