Skip to content

Commit a877b90

Browse files
committed
fix(logic): datastore text array filters;
- Add condition and parsing for string filters to text array data types.
1 parent f2ad59f commit a877b90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

ckanext/datastore/backend/postgres.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -601,10 +601,10 @@ def _where_clauses(
601601
# this fixes parity there.
602602
value = (str(v) for v in value)
603603
clause = (clause_str, dict(zip(placeholders, value)))
604-
elif isinstance(value, str) and field_array_type:
604+
elif type(value) in (str, int, float) and field_array_type:
605605
# (canada fork only): transform string filters for _text type
606606
# TODO: upstream contrib!!
607-
value = [v.strip() for v in value.split(',')]
607+
value = [v.strip() for v in str(value).split(',')]
608608
placeholders = [
609609
f"value_{next(idx_gen)}" for _ in value
610610
]

0 commit comments

Comments
 (0)