Introduction to Apache Airflow in Python
Mike Metzger
Data Engineer
What is an SLA?
Using the 'sla'
argument on the task
task1 = BashOperator(task_id='sla_task',
bash_command='runcode.sh',
sla=timedelta(seconds=30),
dag=dag)
On the default_args
dictionary
default_args={
'sla': timedelta(minutes=20),
'start_date': datetime(2023,2,20)
}
dag = DAG('sla_dag', default_args=default_args)
datetime
libraryfrom datetime import timedelta
timedelta(seconds=30)
timedelta(weeks=2)
timedelta(days=4, hours=10, minutes=20, seconds=30)
default_args={
'email': ['[email protected]'],
'email_on_failure': True,
'email_on_retry': False,
'email_on_success': True,
...
}
Introduction to Apache Airflow in Python