Templating for Airflow connections
Project description
Templating for Airflow connections
The connection plugin contains an Airflow macro for templating connections in tasks. You can use it like this:
# prints 'mysql'
{{ macros.connection_plugin.get_conn('airflow_db').host }}
connection_plugin.get_conn
returns the Connection object
that you can interact with as described in the documentation.
Installation
pip install airflow-connection-plugin
Demo
To start the docker container simply run the following command in the root directory:
cd example && docker-compose up
After that you can reach the airflow frontend via http://localhost:8080. You will find an example DAG that demonstrates how to retrieve different connection information.
Attention: Be especially careful when using passwords in templates.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Close
Hashes for airflow-connection-plugin-1.0.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 88ac4b00f4c320c3958856ca0a022338a6119d111037061a6802f9406d1faf35 |
|
MD5 | 293ef63f9c27f86f3e8eb697009b5f99 |
|
BLAKE2b-256 | 8ea33242e7a5e14797ad44e3cd183f4b77c281e5aa81dbcef3fd758ebcdca11e |