Skip to content

Commit

Permalink
query:tokenize_query - when using @file, match values with "in" ins…
Browse files Browse the repository at this point in the history
…tead of creating separate expressions
  • Loading branch information
MatteoCampinoti94 committed Jan 8, 2025
1 parent 998902f commit 4bf739b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion digiarch/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def tokenize_query(query_string: str, default_field: str, allowed_fields: list[s
from_file = False
elif from_file:
with open(token) as fh:
query_tokens.extend([(field, line_, "=") for line in fh.readlines() if (line_ := line.strip())])
query_tokens.append((field, [line for l in fh.readlines() if (line := l.rstrip("\r\n"))], "in"))
else:
query_tokens.append((field, token, "like" if like else "="))

Expand Down

0 comments on commit 4bf739b

Please sign in to comment.