def _AddFilter(self, candidate_filter):
    if self._query_final is not None:
      raise AttributeError('Can\'t add more filters. Query info is final.')

    if not isinstance(candidate_filter, ndb.FilterNode):
      raise TypeError('Only simple filters can be used. Received: %s.' %
                      (candidate_filter,))
    opsymbol = candidate_filter._FilterNode__opsymbol
    if opsymbol != '=':
      raise ValueError('Only equality filters allowed. Received: %s.' %
                       (opsymbol,))

    self._filters.add(candidate_filter)
Checks a filter and sets it in the filter set.
dataset/ETHPy150Open GoogleDeveloperExperts/experts-app-backend/endpoints_proto_datastore/ndb/model.py/_EndpointsQueryInfo._AddFilter