airflow.secrets.metastore

Objects relating to sourcing connections from metastore database.

Module Contents

Classes

MetastoreBackend

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]

Return connection object with a given conn_id.

Tries get_conn_value first and if not implemented, tries get_conn_uri

Parameters

conn_id (str) – connection id

get_connections(conn_id, session=NEW_SESSION)[source]

Return connection object with a given conn_id.

Parameters

conn_id (str) – connection id

get_variable(key, session=NEW_SESSION)[source]

Get Airflow Variable from Metadata DB.

Parameters

key (str) – Variable Key

Returns

Variable Value

Return type

str | None

Was this entry helpful?