2025 年 Airflow Summit 即将到来,日期为 10 月 07-09 日。立即注册获取早鸟票!

airflow.secrets.metastore

与从 metastore 数据库获取连接相关的对象。

MetastoreBackend

从 airflow metastore 数据库检索 Connection 对象和 Variable。

模块内容

class airflow.secrets.metastore.MetastoreBackend[source]

基类: airflow.secrets.BaseSecretsBackend

从 airflow metastore 数据库检索 Connection 对象和 Variable。

get_connection(conn_id, session=NEW_SESSION)[source]

从元数据数据库获取 Airflow Connection。

参数:
返回:

Connection 对象

返回类型:

airflow.models.Connection | None

get_variable(key, session=NEW_SESSION)[source]

从元数据数据库获取 Airflow Variable。

参数:
返回:

Variable 值

返回类型:

str | None

此条目是否有帮助?