fix(MetaFieldRanker): apply missing_meta when no document has the field - #12963
Merged
anakin87 merged 2 commits intoSep 28, 2026
Merged
Conversation
When every document lacks the ranking field, run() returned the input documents unchanged, bypassing the configured missing_meta policy: a batch with one rated document dropped the unrated ones, while an entirely unrated batch passed through intact even with missing_meta="drop". Apply the policy in that branch as well (drop -> empty list, top/bottom keep the documents, as before) and keep the warning that explains the situation.
Contributor
|
@sclfcz is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
anakin87
approved these changes
Sep 28, 2026
anakin87
left a comment
Member
There was a problem hiding this comment.
I did a minor adjustment.
Thank you
anakin87
enabled auto-merge (squash)
September 28, 2026 13:00
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Fixes #12952
What
MetaFieldRanker.run()returns the input documents unchanged when no document has the ranking field:That branch bypasses the configured
missing_metapolicy, somissing_meta="drop"stops filtering exactly in the case where everything should be dropped:It is also inconsistent with the mixed case: with one rated document, the unrated ones are dropped as configured.
Change
Apply the configured policy in that branch too —
dropreturns an empty list,top/bottomkeep returning the documents as before — and keep the existing warning, reworded to say that the policy is applied rather than that ranking is skipped.top_kis untouched for thetop/bottompaths.Testing
test/components/rankers/test_metafield.py::test_missing_meta_drop_when_no_document_has_the_fieldcovers all three policies for the all-missing case; the mixed case is already covered by the existing tests, which are unchanged.-k missing_meta_drop_when_no_document)dropbranch: the same test failstest/components/rankers/test_metafield.py→ 47 passed with the change (full file run in CI)AI assistance
Written with an AI coding assistant (Claude-based agent): it located the branch, ran the before/after reproduction above and wrote the test. I reviewed the diff, the reproduction output and the reasoning, and I take responsibility for the change.