小编Lui*_*ago的帖子

dag.py 引发:“airflow.exceptions.AirflowException:任务缺少 start_date 参数”,但它在代码中给出

我今天尝试创建我的第一个气流 DAG:

from datetime import timedelta
from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from airflow.operators.dummy_operator import DummyOperator
from airflow.operators.python_operator import PythonOperator
from airflow.utils.dates import days_ago

default_args = {
    'owner': 'default_user',
    'start_date': days_ago(2),
    'depends_on_past': True,
    # With this set to true, the pipeline won't run if the previous day failed
    'email': ['demo@email.de'],
    'email_on_failure': True,
    # upon failure this pipeline will send an email to your email set above
    'email_on_retry': False,
    'retries': 5,
    'retry_delay': timedelta(minutes=30),
}

dag = DAG(
    'basic_dag_2',
    default_args=default_args, …
Run Code Online (Sandbox Code Playgroud)

python-3.x airflow airflow-scheduler airflow-operator

8
推荐指数
1
解决办法
9543
查看次数