Skip to content

Commit

Permalink
hotfix: build_filter_conditions (#296)
Browse files Browse the repository at this point in the history
  • Loading branch information
aMahanna authored Nov 13, 2023
1 parent 879434f commit 8e35379
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion arango/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,5 +120,5 @@ def build_filter_conditions(filters: Json) -> str:
if not filters:
return ""

conditions = [f"doc.{k} == {json.dumps(v)}" for k, v in filters.items()]
conditions = [f"doc.`{k}` == {json.dumps(v)}" for k, v in filters.items()]
return "FILTER " + " AND ".join(conditions)
4 changes: 4 additions & 0 deletions tests/test_document.py
Original file line number Diff line number Diff line change
Expand Up @@ -1236,6 +1236,10 @@ def test_document_find(col, bad_col, docs):
bad_col.find({"val": 1})
assert err.value.error_code in {11, 1228}

# Test find by attribute with a space
col.insert({"foo bar": "baz"})
assert len(list(col.find({"foo bar": "baz"}))) == 1


def test_document_find_near(col, bad_col, docs):
col.import_bulk(docs)
Expand Down

0 comments on commit 8e35379

Please # to comment.