简体   繁体   English

Dag 依赖插件:错误:无法从“airflow”导入名称“conf”

[英]Dag dependency Plug in : error : cannot import name 'conf' from 'airflow'

We are trying to implement the dag dependency plug in by using below git hub as reference我们正在尝试使用以下 git 集线器作为参考来实现 dag 依赖插件

https://github.com/ms32035/airflow-dag-dependencies

But we are facing an error:但是我们面临一个错误:

**cannot import name 'conf' from 'airflow'** 

tried checking the below page but didn't helped尝试检查以下页面但没有帮助

https://github.com/apache/airflow/blob/v1-10-stable/airflow/upgrade/rules/fix_conf_not_importable_from_airflow.py

Currently we are in Airflow 2.0.目前我们在 Airflow 2.0。 any one please suggest任何人请建议

Did you actually change:你真的改变了吗:

from airflow import conf

to:到:

from airflow.configuration import conf

As suggested in the upgrade check you referred to?正如您提到的升级检查中的建议?

https://github.com/ms32035/airflow-dag-dependencies/blob/master/dag-dependencies-plugin/dag_dependencies_plugin.py#L4 https://github.com/ms32035/airflow-dag-dependencies/blob/master/dag-dependencies-plugin/dag_dependencies_plugin.py#L4

I think it should help我认为这应该有所帮助

I would recommend upgrading to Airflow 2.1, the DAG Dependency view was added to core Airflow itself by the author of https://github.com/ms32035/airflow-dag-dependencies in https://github.com/apache/airflow/pull/13199 which was released in Airflow 2.1 as shown in the image below:我建议升级到 Airflow 2.1,DAG 依赖视图已由https://github.com/ms32035/airflow-dag-dependencieshttps://github.com/apache/airflow/的作者添加到核心 Airflow 本身Airflow 2.1中发布的pull/13199如下图所示:

在此处输入图像描述

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

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