'Clears import errors for files that no longer exist.
:param session: session for ORM operations
:type session: sqlalchemy.orm.session.Session
:param known_file_paths: The list of existing files that are parsed for DAGs
:type known_file_paths: list[unicode]'

@staticmethod
@provide_session
def clear_nonexistent_import_errors(session, known_file_paths):

    query = session.query(models.ImportError)
    if known_file_paths:
        query = query.filter((~ models.ImportError.filename.in_(known_file_paths)))
    query.delete(synchronize_session=u'fetch')
    session.commit()
