'Creates the missing states the stats table for the dag specified
:param dag_id: dag id of the dag to create stats for
:param session: database session
:return:'

@staticmethod
@provide_session
def create(dag_id, session=None):

    qry = session.query(DagStat).filter((DagStat.dag_id == dag_id)).all()
    states = [dag_stat.state for dag_stat in qry]
    for state in State.dag_states:
        if (state not in states):
            try:
                session.merge(DagStat(dag_id=dag_id, state=state))
                session.commit()
            except Exception as e:
                session.rollback()
                logging.warning(u'Could    not    create    stat    record')
                logging.exception(e)
