fix(filter): parse JSON-encoded values in FilterTuple before comma split
This commit is contained in:
parent
d609b8e2cc
commit
f4b9c202d6
1 changed files with 6 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
|||
import json
|
||||
import textwrap
|
||||
from collections import defaultdict
|
||||
from collections.abc import Generator, Iterable, Mapping, Sequence
|
||||
|
|
@ -110,7 +111,11 @@ class FilterTuple(_FilterTuple):
|
|||
|
||||
# soundness
|
||||
if operator in ("in", "not in") and isinstance(value, str):
|
||||
value = value.split(",")
|
||||
try:
|
||||
parsed = json.loads(value)
|
||||
value = parsed if isinstance(parsed, list) else [parsed]
|
||||
except ValueError:
|
||||
value = value.split(",")
|
||||
|
||||
_value: Value
|
||||
if isinstance(value, _InputValue):
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue