Summary
get_filter_value() accepts a list as a filter value, but get_query_filter_property() in fairgraph/queries.py doesn't handle one. It picks the operator from the type of the whole value, so a list of Regex or Equals objects falls through to CONTAINS. The generated query then has a CONTAINS filter whose value is a list.
Example
Dataset.list(client, short_name=[Equals("FOO"), Equals("BAR")])
The generated filter is {"op": "CONTAINS", "value": ["FOO", "BAR"]}. There is no error or warning, and the user asked for exact matching. Regex behaves the same way.
Also unclear
- I haven't checked how the KG interprets a
CONTAINS filter with a list value. It may match any element, or all of them, or return nothing.
- For link-typed properties,
get_query_filter_property() calls filter_obj.value.startswith(...) on the value, which would fail on a list. I haven't tried this.
- Nothing in the documentation says whether lists are supported.
Expected behaviour
Filter values in lists should be handled explicitly, either supported or rejected with a clear error. They shouldn't silently change the meaning of the query.
Summary
get_filter_value()accepts a list as a filter value, butget_query_filter_property()infairgraph/queries.pydoesn't handle one. It picks the operator from the type of the whole value, so a list ofRegexorEqualsobjects falls through toCONTAINS. The generated query then has aCONTAINSfilter whose value is a list.Example
The generated filter is
{"op": "CONTAINS", "value": ["FOO", "BAR"]}. There is no error or warning, and the user asked for exact matching.Regexbehaves the same way.Also unclear
CONTAINSfilter with a list value. It may match any element, or all of them, or return nothing.get_query_filter_property()callsfilter_obj.value.startswith(...)on the value, which would fail on a list. I haven't tried this.Expected behaviour
Filter values in lists should be handled explicitly, either supported or rejected with a clear error. They shouldn't silently change the meaning of the query.