Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- args = {
- 'owner': 'me',
- 'start_date': airflow.utils.dates.days_ago(2),
- 'provide_context': True
- }
- dag = DAG('test_timeout',
- schedule_interval=None,
- default_args=args,
- dagrun_timeout=timedelta(seconds=20))
- def this_passes(**kwargs):
- return
- def this_passes_with_delay(**kwargs):
- time.sleep(120)
- return
- would_succeed = PythonOperator(task_id='would_succeed',
- dag=dag,
- python_callable=this_passes,
- email=to)
- would_succeed_with_delay = PythonOperator(task_id='would_succeed_with_delay',
- dag=dag,
- python_callable=this_passes_with_delay,
- email=to)
- would_succeed >> would_succeed_with_delay
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement