Here's a straight forward piece of code, but I found this solution difficult to find and uncover . So here's the solution to getting the data from the Airflow connection in to my DAG - in Google Cloud Platform
from airflow.hooks.base_hook import BaseHook
conn = BaseHook.get_connection('my_conn')
def connect_to_somewhere():
logging.info(conn.login)
logging.info(conn.password)
Hope that helps someone out there !
No comments:
Post a Comment