Repository navigation
fix: validate join_mode in MultiRetriever - #13122
Open
hermanrous wants to merge 1 commit into
Open
hermanrous wants to merge 1 commit into
hermanrous wants to merge 1 commit into
Conversation
Contributor
|
Hi @hermanrous, thanks a lot for your contribution! 🙏 We noticed that the Contributor License Agreement (CLA) check ( To get your PR reviewed, please sign the CLA via the link in the |
HaystackBot
marked this pull request as draft
October 5, 2026 15:32
HaystackBot
marked this pull request as ready for review
October 5, 2026 17:28
Contributor
|
Thanks for signing the CLA, @hermanrous! 🎉 This PR is now ready for review again and the reviewer has been re-assigned. |
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
top_kinMultiRetriever) and fix: validate runtime top_k in MetaFieldRanker #12262 (MetaFieldRanker).Proposed Changes:
MultiRetriever.__init__accepted anyjoin_modevalue. Only the exact string"reciprocal_rank_fusion"selects RRF in_merge_results; every other value falls through to theconcatenatebranch:A typo such as
"Concatenate","rrf", or"reciprocal_rank_fusion "with a trailing space was therefore accepted silently and changed both the scores and the order of the merged documents, with nothing raised. The mistake also stays invisible in pipelines deserialized from YAML, where theLiteralannotation onjoin_modecannot be enforced.This adds a
ValueErrorin__init__naming the two supported modes, using the same wordingMetaFieldRankeruses for itsLiteralparameters.JoinModefromhaystack/components/joiners/document_joiner.pywas deliberately not reused: it has four members (mergeanddistribution_based_rank_fusionincluded) whileMultiRetrieverimplements only two, soJoinMode.from_strwould let the other two fall into the very concatenate branch this PR fixes.How did you test it?
test_init_with_invalid_join_mode_raises, parametrized over"Concatenate","reciprocal-rank-fusion","reciprocal_rank_fusion "and"rrf".main:4 failed, withE Failed: DID NOT RAISE ValueError.4 passed.test/components/retrievers/test_multi_retriever.py:54 passed, 6 skippedbefore,58 passed, 6 skippedafter.test/components/retrievers/:254 passed, 11 skipped.component_from_dictwithjoin_mode="Reciprocal_Rank_Fusion"used to return an instance silently and now raises.ruff check,ruff format --checkandmypyare clean.Environment caveat, same as #12262 and #12719: the suites were run in a plain venv built with
piprather than through Hatch, because the full Hatch environment could not be resolved locally.Notes for the reviewer
:raises ValueError:docstring now also coversjoin_mode.releasenotes/notes/.Checklist
fix:.This PR was fully generated with an AI assistant. I have reviewed the changes and run the relevant tests.