fix: support unhashable metadata comparison values in recall and NDCG evaluators - #12480
Open
CoralGarden52 wants to merge 1 commit into
Open
Conversation
CoralGarden52
requested review from
bogdankostic
and removed request for
a team
August 27, 2026 02:09
|
Someone is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
CoralGarden52
force-pushed
the
fix/support-unhashable-document-comparison
branch
from
August 27, 2026 02:29
69e129e to
4518b89
Compare
Closed
1 task
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
No existing issue was found for this behavior.
Proposed Changes
Document.metasupports JSON-serializable values, including lists and dictionaries.However, when
document_comparison_fieldpoints to such a value:DocumentRecallEvaluatorraisesTypeErrorbecause it stores comparison values in a set.DocumentNDCGEvaluatorraisesTypeErrorbecause it uses comparison values as dictionary keys.This is inconsistent with
DocumentMAPEvaluator, which already supports unhashable comparison values.This change adds a shared internal helper that converts nested list, tuple, and dictionary values into hashable representations while preserving their comparison semantics:
Existing deduplication behavior is preserved:
How did you test it?
Notes for the reviewer
The implementation follows the duplicate-value semantics introduced by
#12255 and
#11959.
This is an internal implementation change with no public API changes.
This PR was fully generated with an AI assistant. The changes have been reviewed and the relevant tests have been run.