Used in https://github.com/mhenc/airflow/blob/master/airflow/dag_processing/manager.py#L613

should be straighforward
return self.dag_id == other.dag_id and self.warning_type == other.warning_type
    def __hash__(self) -> int:
        return hash((self.dag_id, self.warning_type))
    @classmethod
    @provide_session
    def purge_inactive_dag_warnings(cls, session: Session = NEW_SESSION) -> None:
        """
        Deactivate DagWarning records for inactive dags.
        :return: None
        """
        cls._purge_inactive_dag_warnings_with_retry(session)
    @classmethod
    @retry_db_transaction
    def _purge_inactive_dag_warnings_with_retry(cls, session: Session) -> None:
        from airflow.models.dag import DagModel
        if session.get_bind().dialect.name == "sqlite":
            dag_ids = session.query(DagModel.dag_id).filter(DagModel.is_active == false())
            query = session.query(cls).filter(cls.dag_id.in_(dag_ids))
        else:
            query = session.query(cls).filter(cls.dag_id == DagModel.dag_id, DagModel.is_active == false())
        query.delete(synchronize_session=False)
        session.commit()
class DagWarningType(str, Enum):
    """
    Enum for DAG warning types.
    This is the set of allowable values for the ``warning_type`` field
    in the DagWarning model.
    """
    NONEXISTENT_POOL = "non-existent pool"