

@provide_session
def merge_conn(conn, session=None):
    from airflow import models
    C = models.Connection
    if (not session.query(C).filter((C.conn_id == conn.conn_id)).first()):
        session.add(conn)
        session.commit()

dataset/ETHPy150Open airbnb/airflow/airflow/utils/db.py merge_conn/original