Aan de slagGa gratis aan de slag

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

Cursus bekijken

Oefeninstructies

  • Import the timedelta object.
  • Add a 3 hour sla to 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)
Code bewerken en uitvoeren