Skip to content

Commit 3b048b5

Browse files
committed
fix: build_filter_conditions
1 parent 75d7d7a commit 3b048b5

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

arango/utils.py

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"is_none_or_str",
77
]
88

9-
# import json
9+
import json
1010
import logging
1111
from contextlib import contextmanager
1212
from typing import Any, Iterator, Sequence, Union
@@ -120,12 +120,5 @@ def build_filter_conditions(filters: Json) -> str:
120120
if not filters:
121121
return ""
122122

123-
def format_condition(key: str, value: Any) -> str:
124-
if isinstance(value, str):
125-
return f'doc.{key} == "{value}"'
126-
127-
return f"doc.{key} == {value}"
128-
129-
# conditions = [f"doc.{k} == {json.dumps(v)}" for k, v in filters.items()]
130-
conditions = [format_condition(k, v) for k, v in filters.items()]
123+
conditions = [f"doc.{k} == {json.dumps(v)}" for k, v in filters.items()]
131124
return "FILTER " + " AND ".join(conditions)

0 commit comments

Comments
 (0)