Files
airflow/dags/mt/mt_dag.py
T
2022-07-01 16:13:46 +08:00

33 lines
1.1 KiB
Python

from airflow.operators.bash import BashOperator
import pendulum
from airflow import DAG
with DAG(
dag_id="mt_dag",
# 每月5日运行
schedule_interval="0 5 5 * *",
start_date=pendulum.datetime(2022, 6, 28, tz="Asia/Shanghai"),
catchup=True,
) as dag:
t1 = BashOperator(
task_id='mt_comm',
bash_command='python /opt/airflow/dags/repo/dags/mt/supply/comm.py {{ dag_run.conf["output_date"] }}',
)
t2 = BashOperator(
task_id='mt_rent_avg_price',
bash_command='python /opt/airflow/dags/repo/dags/mt/supply/rent_avg_price.py {{ dag_run.conf["output_date"] }}',
)
t3 = BashOperator(
task_id='mt_facilitys',
bash_command='python /opt/airflow/dags/repo/dags/mt/supply/facilitys.py {{ dag_run.conf["output_date"] }}',
)
t4 = BashOperator(
task_id='mt_deal',
bash_command='python /opt/airflow/dags/repo/dags/mt/supply/deal.py {{ dag_run.conf["output_date"] }}',
)
t5 = BashOperator(
task_id='mt_stat',
bash_command='python /opt/airflow/dags/repo/dags/mt/supply/data_stat.py {{ dag_run.conf["output_date"] }}',
)
t1 >> t2 >> t3 >> t4 >> t5