airflow.secrets.metastore
¶
Objects relating to sourcing connections from metastore database.
Module Contents¶
Classes¶
Retrieves Connection object and Variable from airflow metastore database. |
- class airflow.secrets.metastore.MetastoreBackend[source]¶
Bases:
airflow.secrets.BaseSecretsBackend
Retrieves Connection object and Variable from airflow metastore database.
- get_connection(conn_id, session=NEW_SESSION)[source]¶
Get Airflow Connection from Metadata DB.
- Parameters
conn_id (str) – Connection ID
session (sqlalchemy.orm.Session) – SQLAlchemy Session
- Returns
Connection Object
- Return type
airflow.models.Connection | None
- get_variable(key, session=NEW_SESSION)[source]¶
Get Airflow Variable from Metadata DB.
- Parameters
key (str) – Variable Key
session (sqlalchemy.orm.Session) – SQLAlchemy Session
- Returns
Variable Value
- Return type
str | None