This commit is contained in:
2021-12-30 14:50:21 +08:00
parent b5a2dccaee
commit c02f746804
2 changed files with 32 additions and 4 deletions
+30
View File
@@ -0,0 +1,30 @@
from datetime import datetime, timedelta
from textwrap import dedent
from airflow import DAG
from airflow.operators.bash import BashOperator
# These args will get passed on to each operator
# You can override them on a per-task basis during operator initialization
default_args = {
'owner': '王文艳',
'depends_on_past': False,
'email': ['wangwenyan@fangjia.com'],
'email_on_failure': False,
'email_on_retry': False,
'retries': 1,
'retry_delay': timedelta(minutes=5),
}
with DAG(
'定时样例',
default_args=default_args,
description='A simple tutorial DAG',
schedule_interval=timedelta(minutes=1),
start_date=datetime(2021, 1, 1),
catchup=False,
tags=['样例'],
) as dag:
t1 = BashOperator(
task_id='print_date',
bash_command='date',
)
+2 -4
View File
@@ -1,11 +1,9 @@
from datetime import datetime, timedelta
from textwrap import dedent
#Test
# The DAG object; we'll need this to instantiate a DAG
from airflow import DAG
import pandas as pd
# Operators; we need this to operate!
from airflow.operators.bash import BashOperator
# These args will get passed on to each operator
# You can override them on a per-task basis during operator initialization
default_args = {