BioplatformsAustralia / bpaotu

OTU database access for the Australian Microbiome
GNU Affero General Public License v3.0
5 stars 1 forks source link

query.apply_op_and_array_filter() treats "is not" same as "is" #171

Closed hou098 closed 2 years ago

hou098 commented 2 years ago

See https://github.com/BioplatformsAustralia/bpaotu/blob/1.32.12/bpaotu/bpaotu/query.py#L914

if op_and_array.get('operator', 'is') == 'isnot':
        q = q.filter(attr.any(value)) 
    else:
        q = q.filter(attr.any(value))
    return q

Huh? This can't be right. "isnot" case should probably be attr.all(value, operator=operator.ne)

traits_filter_query stuff in views.taxonomy_graph_fields() - needs fixing too. Looks like an attempt to fix up the underlying problem in-memory but fails at that too.

hou098 commented 2 years ago

Fixed in https://github.com/BioplatformsAustralia/bpaotu/commit/f8b64f3f081624221642e402c231a02480712ee1