airflow - Apache Airflow 问题 - "a task with task_id create_tag_template_field_result is already in the DAG"

标签 airflow

所以,即使是空白的 Airflow 安装,我也有问题。
只要我试着跑

airflow test tutorial print_date 2015-06-01
我收到一个引发的异常,上面写着
PendingDeprecationWarning:无法将请求的任务添加到 DAG,因为具有 task_id create_tag_template_field_result 的任务已在 DAG 中。从 Airflow 2.0 开始,尝试覆盖任务将引发异常。
这是什么原因(因为我实际上没有对安装进行任何更改)?
在以前的安装中,当我尝试运行自己的 dag 时,我也遇到了这个问题……但是在我的代码中找不到“create_tag_template_field_result”。

最佳答案

您可以设置配置参数 load_examples = False 来解决它。
这是测试命令将调用 get_dag 函数,它将构造一个 DagBag 对象,在构造函数中将调用 collect_dags 函数。
当 conf arg LOAD_EXAMPLES=True(default True) 时,collect_dags 函数将收集示例路径中的所有 dag,这就是任务 create_tag_template_field_result 的来源。
在 collect_dags 函数中,每个示例任务都会调用 add_task 函数,这就是您再次添加 create_tag_template_field_result 任务的地方。
也许这是您第一次添加此任务而您没有意识到的快速入门。
您可以设置配置参数 load_examples = False 来解决它

关于airflow - Apache Airflow 问题 - "a task with task_id create_tag_template_field_result is already in the DAG",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63883021/

相关文章:

python - Airflow 默认on_failure_callback

postgresql - 如何在 Google Cloud Platform 上将数据库(postgres)连接到 Airflow Composer?

python - Airflow 没有正确安排 Python

python - Airflow 界面中的干净 TreeView

pytorch - 在 PythonVirtualenvOperator 中使用除 pip 之外的其他来源下载

kubernetes - 使用 Airflow KubernetesPodOperator 的私有(private)镜像

python - Airflow GKEPodOperator xcom_push 返回 None

ubuntu - 如何在远程服务器上本地访问 Apache Airflow 网络服务器

Airflow DAG "seems to be existing only locally. The master scheduler doesn' t 似乎意识到它的存在”

docker - 设置 Apache Airflow 时无法执行脚本 docker-compose