fix: updating generated answer and extracted answers serialisation#11805
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. |
…swers-serialisation
Copy the meta dict before reassigning all_messages so deserialization no longer mutates the caller's input. Matches the no-mutation behavior of ExtractedAnswer.from_dict and Document.from_dict. Adds a regression test. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
julian-risch
left a comment
There was a problem hiding this comment.
Looks good to me now. I pushed a small change myself. The serialization/deserialization roundtrip of GenerateAnswer was broken in the sense that it mutated meta. That was an issue before in GeneratedAnswer and in ExtractedAnswer. Your changes fixed it for ExtractedAnswer and so pushed a small change to achieve consistency.
Regarding the corresponding issue: Let's not close it directly. I would like us to align with @anakin87 and @sjrl if there are really no serialization changes we want to roll out with Haystack 3.0.
Related Issues
Proposed Changes:
GeneratedAnswerandExtractedAnswerwere serializing viadefault_to_dict/default_from_dictHow did you test it?
_legacyand kept to verify backward compatibility.Notes for the reviewer
from_dict()still accepts the old format (e.g. from a saved pipeline snapshot), it unwraps init_parameters before processing.Checklist
fix:,feat:,build:,chore:,ci:,docs:,style:,refactor:,perf:,test:and added!in case the PR includes breaking changes.