我用下面的代码构建了一个日期:
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
在终端使用airflow dags list
也未见,仅显示标准气流包,而未显示my。我的文件夹的位置很好它位于文件夹
您的导入语句中有一个错别字。气流忽略不包含"气流"one_answers"DAG"的文件。您的DAG文件没有被解析,因为您拼错了单词"气流"。