use Airflow connection from a jinja template
问题 I'm trying to pass DB params to BashOperator using environment variables, but I can't find any documentation/examples how to use a connection from a Jinja template. So I'm looking for something similar to variables echo {{ var.value.<variable_name> }} 回答1: Airflow does not provide such macros. However you can create custom macros to address this. Connection example: Creating the macros: def get_host(conn_id): connection = BaseHook.get_connection(conn_id) return connection.host def get_schema