简体   繁体   English

Dag 在 Airflow UI 上不可见,也不显示在 dags 列表中

[英]Dag is not visible on Airflow UI and not show in dags list

I build a dag using this code:我使用以下代码构建了一个 dag:

from airlow import DAG
from airlow.operators.bash import BashOperator

from datetime import datetime

default_args = {
    'start_date': datetime(2020, 1,1)
}

with DAG('parallel_dag', schedule_interval='@daily', default_args=default_args, catchup=False) as dag:

    task_1 = BashOperator(
        task_id = 'task_1',
        bash_command = 'sleep 3'
    )

    task_2 = BashOperator(
        task_id = 'task_2',
        bash_command = 'sleep 3'
    )

    task_3 = BashOperator(
        task_id = 'task_3',
        bash_command = 'sleep 3'
    )

    task_4 = BashOperator(
        task_id = 'task_4',
        bash_command = 'sleep 3'
    )

    task_1 >> [task_2, task_3] >> task_4

And it is also not seen using airflow dags list in terminal only standard airflow dags is shown but no my.并且在终端中使用airflow dags list也没有看到,仅显示标准气流 dags,但没有我的。 And with location of my dag is all good it is located in dags folder而且我的 dag 的位置很好,它位于 dags 文件夹中

You have a typo in your import statements.您的导入语句中有错字。 Airflow ignores files not containing “airflow” and “DAG”. Airflow 会忽略不包含“airflow”和“DAG”的文件。 Your DAG File was not parsed since you have misspelled the word airflow.由于您拼错了气流一词,因此未解析您的 DAG 文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM