def _handle_simple_filters(self, q):
        # handle simple filters
        if 'flt' in self.api_arguments:
            flt = json.loads(
                self.api_arguments['flt']) \
                    if isinstance(self.api_arguments['flt'], str) \
                    else self.api_arguments['flt']
            if isinstance(flt, dict):
                flt = [flt]

            print(flt)

            for f in flt:
                default = f.get('default', False)
                op = f.get('op', '==')
                if op == '==':
                    q = q.filter({f['lhs']: f['rhs']}, default=default)
                elif op == '!=':
                    q = q.filter(r.row[f['lhs']] != f['rhs'], default=default)
                elif op == '<':
                    q = q.filter(r.row[f['lhs']] < f['rhs'], default=default)
                elif op == '<=':
                    q = q.filter(r.row[f['lhs']] <= f['rhs'], default=default)
                elif op == '>':
                    q = q.filter(f['rhs'] > r.row[f['lhs']], default=default)
                elif op == '>=':
                    q = q.filter(r.row[f['lhs']] >= f['rhs'], default=default)
                elif op == 'match':
                    field = f['lhs']
                    pattern  = f['rhs']
                    q = q.filter(lambda x: x[field].match(pattern), default=default)
                elif op == 'contains':
                    field = f['lhs']
                    pattern  = f['rhs']
                    q = q.filter(lambda x: x[field].contains(pattern))
                elif op == 'has_fields':
                    q = q.filter(lambda x: x.has_fields(f['fields']), default=default)
                else:
                    raise ValidationError("Unrecognized op in filter specification.")
        return q
dataset/ETHPy150Open JeffHeard/sondra/sondra/api.py/APIRequest._handle_simple_filters/swapped operands of `>`