Commit ddea3ec6 authored by 吴升宇's avatar 吴升宇

测试月份

parent 440a8aa6
# airflow-dags-hub
airflow 测试环境:
http://62.234.197.54:8080/home
账号: user
pw: OqUHFWzkU1
\ No newline at end of file
# -*- coding: utf-8 -*-
from datetime import timedelta, datetime
import calendar
from airflow import DAG
from airflow.operators.postgres_operator import PostgresOperator
from airflow.utils.dates import days_ago
default_args = {
'owner': 'user',
'depends_on_past': False,
'start_date': days_ago(1),
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
dag = DAG(
'psql_reflush_per_month',
default_args=default_args,
catchup=False,
description='',
schedule_interval='10 3 7 * *', # 每月7号11点10执行一次
)
sql1 = 'refresh materialized view concurrently materialized_doctor_view'
t1: PostgresOperator = PostgresOperator(
task_id='psql_reflush_per_month_task_001',
postgres_conn_id='postgres-test',
sql=sql1,
dag=dag,
database='pims')
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment