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
|
from docker.types import Mount
from airflow import DAG
from airflow.utils.dates import days_ago
from airflow.decorators import task
from airflow.operators.bash import BashOperator
from airflow.operators.python import PythonOperator
from airflow.providers.docker.operators.docker import DockerOperator
from wepy.utils.init import *
import pendulum
local_tz = pendulum.timezone("Asia/Shanghai") ## 设置时区
DEFAULT_ARGS = {
'owner' : 'william',
'email' : 'lfang@wuyacapital.com',
'email_on_failure' : False,
'email_on_retry' : False,
'retries' : 3,
'retry_delay' : timedelta(minutes=1)
}
with DAG(
dag_id = "pretrading.all.csv",
default_args = DEFAULT_ARGS,
schedule = "35 08,20 * * 1-5",
start_date = datetime(2023, 1, 1, tzinfo=local_tz), ## 指定时区
catchup = False,
dagrun_timeout = timedelta(seconds=60*3),
tags = ['pretrading', 'all.csv'],
) as dag:
|