Repository navigation
fix: Qdrant - match no documents for an empty in filter - #4346
Open
astroknot-sheep wants to merge 1 commit into
Open
astroknot-sheep wants to merge 1 commit into
astroknot-sheep wants to merge 1 commit into
Conversation
astroknot-sheep
requested review from
julian-risch
and removed request for
a team
November 27, 2026 15:25
in filter
Contributor
Coverage report (qdrant)Click to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issues
infilter with an empty list matches all documents (delete_by_filter deletes everything) #4334Proposed Changes:
_build_in_conditionreturnedFilter(should=[...]). For an empty list this isFilter(should=[]), which Qdrant treats as no condition, soin []matched every point. Throughdelete_by_filter()this deleted the whole collection.Now an empty list gives
FieldCondition(key=key, match=MatchAny(any=[])), which matches nothing. Non-empty lists andnot inare unchanged. All sync and async paths (filter_documents,count_documents_by_filter,delete_by_filter,update_by_filter, retrievers) use the same converter, so they are all fixed.How did you test it?
:memory:) checkingfilter_documents,count_documents_by_filter,NOTof the filter anddelete_by_filter. Both fail onmainand pass with this change.integrations/qdrant: fullpytest tests424 passed, 1 skipped (with a local Qdrant 1.20.0 server running);ruff check,ruff format --checkandmypy(thetypesscript) clean.MatchAny(any=[])matches no points on a real Qdrant 1.20.0 server, not only in local mode.Notes for the reviewer
I used AI assistance while investigating and drafting this PR. I reviewed every line and ran the tests myself.
Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:.