You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2020/03/27 23:45:42 UTC
[GitHub] [airflow] kaxil commented on a change in pull request #7923: [WIP]
Get Airflow Connection from Environment Variables & SecretsBackend
kaxil commented on a change in pull request #7923: [WIP] Get Airflow Connection from Environment Variables & SecretsBackend
URL: https://github.com/apache/airflow/pull/7923#discussion_r399585371
##########
File path: airflow/secrets/metastore.py
##########
@@ -37,3 +37,16 @@ def get_connections(self, conn_id, session=None) -> List[Connection]:
conn_list = session.query(Connection).filter(Connection.conn_id == conn_id).all()
session.expunge_all()
return conn_list
+
+ @provide_session
+ def get_variable(self, key: str, session=None):
+ """
+ Get Airflow Variable from Metadata DB
+
+ :param key: Variable Key
+ :return: Variable Value
+ """
+ from airflow.models.variable import Variable
Review comment:
Yup, I will try to get rid of it as soon as I have the final draft ready :)
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
With regards,
Apache Git Services