'Store an XCom value.'

@classmethod
@provide_session
def set(cls, key, value, execution_date, task_id, dag_id, session=None):

    session.expunge_all()
    session.query(cls).filter((cls.key == key), (cls.execution_date == execution_date), (cls.task_id == task_id), (cls.dag_id == dag_id)).delete()
    session.commit()
    session.add(XCom(key=key, value=value, execution_date=execution_date, task_id=task_id, dag_id=dag_id))
    session.commit()
