gpt4 book ai didi

Airflow 弃用警告

转载 作者:行者123 更新时间:2023-12-02 01:28:18 28 4
gpt4 key购买 nike

我正在使用官方 Docker 镜像运行分布式 Airflow 2.4.0 设置。所有容器都使用相同的 .env 文件和相同版本的 Airflow 图像。当我登录其中一个 Airflow 容器时,我收到此警告:

/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:545: DeprecationWarning: The sql_alchemy_conn option in [core] has been moved to the sql_alchemy_conn option in [database] - the old setting has been used, but please update your config.
option = self._get_environment_variables(deprecated_key, deprecated_section, key, section)
/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:545: DeprecationWarning: The auth_backend option in [api] has been renamed to auth_backends - the old setting has been used, but please update your config.
option = self._get_environment_variables(deprecated_key, deprecated_section, key, section)
/home/airflow/.local/lib/python3.7/site-packages/airflow/configuration.py:367: FutureWarning: The auth_backends setting in [api] has had airflow.api.auth.backend.session added in the running config, which is needed by the UI. Please update your config before Apache Airflow 3.0.
FutureWarning,

我检查了容器内的 airflow.cfg,它有最新的变量。为什么我仍然收到警告消息?

最佳答案

您看到这些变量是因为该部分。 airflow.cfg 是带有部分的配置文件。设置应位于适当的部分。

在您的情况下,您的 airflow.cfg 具有 sql_alchemy_conn,您可以在其中覆盖默认值。在 2.3.0 之前,此设置在 core section 中在 2.3.0 中它被移动到 database section . (参见 PR)

您需要做的只是打开 airflow.cfg 并将设置移动到适当的部分。例如:

[core]

sql_alchemy_conn = sqlite:///{AIRFLOW_HOME}/airflow.db

到:

[database]

sql_alchemy_conn = sqlite:///{AIRFLOW_HOME}/airflow.db

为什么会这样,在docs中也有解释。 .通过格式为 AIRFLOW__{SECTION}__{KEY} 的环境变量进行 Airflow 引用设置,因此在这种情况下它将是:AIRFLOW__DATABASE__SQL_ALCHEMY_CONN 因此该部分对于查找变量很重要。

关于 Airflow 弃用警告,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/73895281/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com