from airflow.operators.bash import BashOperator import pendulum from airflow import DAG with DAG( "community_summary_dag", # 每月2日1点整分运行 schedule_interval="0 1 2 * *", start_date=pendulum.datetime(2022, 10, 12, tz="Asia/Shanghai"), catchup=True, description="地址输出信息分类数据定时更新" ) as dag: # t1 = BashOperator( # task_id='comm_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/comm.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t2 = BashOperator( # task_id='price_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t3 = BashOperator( # task_id='sell_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/sell.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t4 = BashOperator( # task_id='avg_cost_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/avg_cost.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t5 = BashOperator( # task_id='trade_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/trade.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t6 = BashOperator( # task_id='total_price_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t6_1 = BashOperator( # task_id='total_price_complete_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/total_price_complete.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t7 = BashOperator( # task_id='traffic_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/traffic.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t8 = BashOperator( # task_id='medical_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/medical.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t9 = BashOperator( # task_id='life_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/life.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t10 = BashOperator( # task_id='relative_price_ranking_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/relative_price_ranking.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t11 = BashOperator( # task_id='consumption_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/consumption.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t12 = BashOperator( # task_id='price_rating_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/price_rating.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t13 = BashOperator( # task_id='education_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) # t14 = BashOperator( # task_id='education2_dag', # bash_command='python /opt/airflow/dags/repo/dags/business/business/community/education2.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', # ) t15 = BashOperator( task_id='extra_dag', bash_command='python /opt/airflow/dags/repo/dags/business/business/community/extra.py {{dag_run.conf["type"] if "type" in dag_run.conf}}', ) t15 # t1 >> t2 >> t3 >> t4 >> t5 >> t6 >> t6_1 >> t7 >> t8 >> t9 >> t10 >> t11 >> t12 >> t13 >> t14 >> t15