"""Payments Generate Export DAG.""" from datetime import datetime from airflow import DAG from airflow.operators.python import PythonOperator from lib import constants from tasks.payments_generate_export.archive_existing_report \ import archive_existing_summary_report_task from tasks.payments_generate_export.generate_summary_report \ import generate_payment_summary_export_task from tasks.payments_generate_export.notify_failure import notify_failure_task from tasks.payments_generate_export.notify_started import notify_started_task from tasks.payments_generate_export.notify_success import notify_success_task from tasks.payments_generate_export.upsert_report import upsert_report_task dag = DAG( constants.DAG_PAYMENTS_GENERATE_EXPORT_NAME, description='Generate Export of current payment_group_payment_accounts as tsv', start_date=datetime(2019, 1, 1), default_args={'provide_context': True}, schedule_interval=None ) """ ###################################################################### ############################# OPERATORS ############################## ###################################################################### """ archive_existing_summary_report_operator = PythonOperator( dag=dag, python_callable=archive_existing_summary_report_task, task_id='archive_existing_summary_report' ) generate_new_summary_report_operator = PythonOperator( dag=dag, python_callable=generate_payment_summary_export_task, task_id='generate_new_summary_report' ) notify_failure_operator = PythonOperator( dag=dag, python_callable=notify_failure_task, task_id='notify_failure', trigger_rule='one_failed' ) notify_started_operator = PythonOperator( dag=dag, python_callable=notify_started_task, task_id='notify_started' ) notify_success_operator = PythonOperator( dag=dag, python_callable=notify_success_task, task_id='notify_success', trigger_rule='none_failed' ) save_summary_report_export_url_operator = PythonOperator( dag=dag, python_callable=upsert_report_task, task_id='save_summary_report_export_url' ) """ ###################################################################### ################################ DAG ################################# ###################################################################### """ notify_started_operator >> \ archive_existing_summary_report_operator >> \ generate_new_summary_report_operator >> \ save_summary_report_export_url_operator >> \ notify_success_operator >> \ notify_failure_operator