def get_connection(conn_id):
    """Returns a connection by id
    """
    from airflow import settings, models
    session = settings.Session()
    return session.query(models.Connection).filter_by(conn_id=conn_id).first()
