def _handle_aggregations(self, q):
        # handle aggregation queries
        if self.api_arguments in 'agg':
            op = json.loads(self.api_arguments['agg'])
            if op['name'] not in self.SAFE_OPS:
                raise ValidationError("Cannot perform unsafe op in GET")
            q = getattr(q, op['name'])(*op.get('args',[]), **op.get('kwargs', {}))
        return q
dataset/ETHPy150Open JeffHeard/sondra/sondra/api.py/APIRequest._handle_aggregations/swapped operands of `in`