IniziaInizia gratis

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.

Questo esercizio fa parte del corso

Introduction to Apache Airflow in Python

Visualizza il corso

Istruzioni dell'esercizio

  • Import the timedelta object.
  • Add a 3 hour sla to the task.

Esercizio pratico interattivo

Prova a risolvere questo esercizio completando il codice di esempio.

# 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)
Modifica ed esegui il codice