Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fix serialization of DocumentRecallEvaluator #7662

Merged
merged 2 commits into from
May 8, 2024

Conversation

anakin87
Copy link
Member

@anakin87 anakin87 commented May 7, 2024

Related Issues

this fails because the RecallMode Enum is not YAML-serializable:

from haystack import Pipeline
from haystack.components.evaluators.document_recall import DocumentRecallEvaluator

p = Pipeline()
p.add_component("eval", DocumentRecallEvaluator())
dump = p.dumps()

p2 = Pipeline.loads(dump)

Proposed Changes:

  • add to_dict method to handle the serialization

How did you test it?

CI, new unit tests, manual test

Checklist

@anakin87 anakin87 requested review from a team as code owners May 7, 2024 13:39
@anakin87 anakin87 requested review from dfokina and vblagoje and removed request for a team May 7, 2024 13:39
@github-actions github-actions bot added topic:tests 2.x Related to Haystack v2.0 type:documentation Improvements on the docs labels May 7, 2024
@coveralls
Copy link
Collaborator

coveralls commented May 7, 2024

Pull Request Test Coverage Report for Build 9002627521

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.03%) to 90.365%

Totals Coverage Status
Change from base Build 8938725904: 0.03%
Covered Lines: 6518
Relevant Lines: 7213

💛 - Coveralls

@masci masci added this to the 2.1.1 milestone May 7, 2024
Copy link
Member

@vblagoje vblagoje left a comment

Choose a reason for hiding this comment

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

LGTM, left one minor optional comment

@anakin87 anakin87 merged commit 9446714 into main May 8, 2024
23 checks passed
@anakin87 anakin87 deleted the fix-serialization-docrecallevaluator branch May 8, 2024 14:00
silvanocerza pushed a commit that referenced this pull request May 9, 2024
* fix serialization of DocumentRecallEvaluator

* add requested tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.x Related to Haystack v2.0 topic:tests type:documentation Improvements on the docs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants