airflow.secrets.metastore¶
与从 metastore 数据库获取连接相关的对象。
类¶
从 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。
- 参数:
conn_id (str) – 连接 ID
session (sqlalchemy.orm.Session) – SQLAlchemy Session
- 返回:
Connection 对象
- 返回类型:
airflow.models.Connection | None
- get_variable(key, session=NEW_SESSION)[source]¶
从元数据数据库获取 Airflow Variable。
- 参数:
key (str) – Variable 键
session (sqlalchemy.orm.Session) – SQLAlchemy Session
- 返回:
Variable 值
- 返回类型:
str | None