1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | # -*- coding: utf-8 -*-
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from eod_pd import *
# -------------------------------------------------------------------------------
# dag
# these args will get passed on to each operator
default_args = {
'owner': 'TongYu',
'catchup': False,
'start_date': utils.trans_utc_datetime('0:00:00'),
}
dag = DAG(
'eod_scenario_dag',
catchup=False,
default_args=default_args,
schedule_interval='0 0-8 * * *',
dagrun_timeout=timedelta(minutes=60),
description='eod scenario valuation dag')
# -------------------------------------------------------------------------------
eod_scenario_valuation_calc_operator = PythonOperator(
task_id='eod_scenario_valuation_calc_task',
python_callable=scenario_valuation_calc,
execution_timeout=timedelta(minutes=5),
dag=dag)
|