Skip to content

fix(tests): eq and neq operator for qdrant filtering #388

Merged
samsja merged 2 commits into
mainfrom
fix-equal-filter-qdrant
Jun 2, 2022
Merged

fix(tests): eq and neq operator for qdrant filtering #388
samsja merged 2 commits into
mainfrom
fix-equal-filter-qdrant

Conversation

@samsja

@samsja samsja commented Jun 1, 2022

Copy link
Copy Markdown
Member

Context

Pre-filtering with the operator equal is not working with qdrant backend. See full issue for details #387

Solution

To do filtering with with eq and neq one should use the match keyword.

for eq:

filter = {'must': [{'key': 'price', 'match': {'value': 7}}]}

for neq:

filter = {'must_not': [{'key': 'price', 'match': {'value': 7}}]}

What this pr do

This pr fix the test to use this notation for the filter

@samsja samsja marked this pull request as draft June 1, 2022 14:31
@codecov

codecov Bot commented Jun 1, 2022

Copy link
Copy Markdown

Codecov Report

Merging #388 (dfabcb6) into main (1b79312) will increase coverage by 1.71%.
The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #388      +/-   ##
==========================================
+ Coverage   84.57%   86.29%   +1.71%     
==========================================
  Files         134      134              
  Lines        6368     6368              
==========================================
+ Hits         5386     5495     +109     
+ Misses        982      873     -109     
Flag Coverage Δ
docarray 86.29% <100.00%> (+1.71%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
docarray/__init__.py 100.00% <100.00%> (ø)
docarray/array/mixins/match.py 75.00% <100.00%> (ø)
docarray/helper.py 76.56% <0.00%> (+0.41%) ⬆️
docarray/math/ndarray.py 90.00% <0.00%> (+0.66%) ⬆️
docarray/array/storage/memory/find.py 91.22% <0.00%> (+1.75%) ⬆️
docarray/array/storage/sqlite/seqlike.py 85.18% <0.00%> (+1.85%) ⬆️
docarray/array/storage/weaviate/find.py 86.95% <0.00%> (+2.17%) ⬆️
docarray/array/mixins/io/binary.py 97.45% <0.00%> (+2.54%) ⬆️
docarray/array/storage/weaviate/seqlike.py 77.41% <0.00%> (+3.22%) ⬆️
docarray/array/mixins/io/from_gen.py 83.63% <0.00%> (+3.63%) ⬆️
... and 15 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5870c55...dfabcb6. Read the comment docs.

@github-actions github-actions Bot added size/s and removed size/xs labels Jun 1, 2022
@samsja samsja changed the title feat: add assert on len of results in filter test fix(tests): eq and neq operator for qdrant filtering Jun 1, 2022
@samsja samsja marked this pull request as ready for review June 1, 2022 15:58

@davidbp davidbp left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@samsja samsja merged commit 1df47c4 into main Jun 2, 2022
@samsja samsja deleted the fix-equal-filter-qdrant branch June 2, 2022 07:27
@samsja samsja linked an issue Jun 2, 2022 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

filter by equal not working with Qdrant

2 participants