新增默认输出日期
This commit is contained in:
+3
-1
@@ -4,6 +4,8 @@ from airflow import DAG
|
|||||||
from goojia_utils import dateutils
|
from goojia_utils import dateutils
|
||||||
import datetime
|
import datetime
|
||||||
|
|
||||||
|
output_date = dateutils.format_date(datetime.datetime.now(), '%Y%m')
|
||||||
|
|
||||||
with DAG(
|
with DAG(
|
||||||
dag_id="mt_dag",
|
dag_id="mt_dag",
|
||||||
# 每月5日运行
|
# 每月5日运行
|
||||||
@@ -11,7 +13,7 @@ with DAG(
|
|||||||
start_date=pendulum.datetime(2022, 6, 28, tz="Asia/Shanghai"),
|
start_date=pendulum.datetime(2022, 6, 28, tz="Asia/Shanghai"),
|
||||||
catchup=True,
|
catchup=True,
|
||||||
default_args={
|
default_args={
|
||||||
"output_date": dateutils.format_date(datetime.datetime.now(), '%Y%m')
|
"output_date": output_date
|
||||||
}
|
}
|
||||||
) as dag:
|
) as dag:
|
||||||
t1 = BashOperator(
|
t1 = BashOperator(
|
||||||
|
|||||||
Reference in New Issue
Block a user