Init
This commit is contained in:
@@ -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
@@ -1,11 +1,9 @@
|
|||||||
from datetime import datetime, timedelta
|
from datetime import datetime, timedelta
|
||||||
from textwrap import dedent
|
from textwrap import dedent
|
||||||
#Test
|
|
||||||
# The DAG object; we'll need this to instantiate a DAG
|
|
||||||
from airflow import DAG
|
from airflow import DAG
|
||||||
import pandas as pd
|
|
||||||
# Operators; we need this to operate!
|
|
||||||
from airflow.operators.bash import BashOperator
|
from airflow.operators.bash import BashOperator
|
||||||
|
|
||||||
# These args will get passed on to each operator
|
# These args will get passed on to each operator
|
||||||
# You can override them on a per-task basis during operator initialization
|
# You can override them on a per-task basis during operator initialization
|
||||||
default_args = {
|
default_args = {
|
||||||
|
|||||||
Reference in New Issue
Block a user