Skip to content

feat: re-add updates to serde of GeneratedAnswer and ExtractedAnswer - #11983

Merged
sjrl merged 2 commits into
mainfrom
fix-serde-dataclasses
Jul 13, 2026
Merged

feat: re-add updates to serde of GeneratedAnswer and ExtractedAnswer#11983
sjrl merged 2 commits into
mainfrom
fix-serde-dataclasses

Conversation

@sjrl

@sjrl sjrl commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Related Issues

Proposed Changes:

Re-adds changes made in #11805 and also updates the from_dict methods of the two dataclasses to support the old serialization format.

How did you test it?

New tests

Notes for the reviewer

Checklist

  • I have read the contributors guidelines and the code of conduct.
  • I have updated the related issue with new insights and changes.
  • I have added unit tests and updated the docstrings.
  • I've used one of the conventional commit types for my PR title: fix:, feat:, build:, chore:, ci:, docs:, style:, refactor:, perf:, test: and added ! in case the PR includes breaking changes.
  • I have documented my code.
  • I have added a release note file, following the contributors guidelines.
  • I have run pre-commit hooks and fixed any issue.

@vercel

vercel Bot commented Jul 13, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
haystack-docs Ignored Ignored Preview Jul 13, 2026 11:13am

Request Review

@sjrl
sjrl requested review from a team as code owners July 13, 2026 11:13
@sjrl
sjrl requested review from julian-risch and removed request for a team July 13, 2026 11:13
@github-actions

Copy link
Copy Markdown
Contributor

Coverage report

Click to see where and how coverage changed

FileStatementsMissingCoverageCoverage
(new stmts)
Lines missing
  haystack/dataclasses
  answer.py
Project Total  

This report was generated by python-coverage-comment-action

@julian-risch julian-risch left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good to me. It's good that the release note points out that any code that calls .to_dict() and then reads result["init_parameters"]["data"] will break because it's now a flat dict with ({"data": ..., "query": ..., ...}). To that extent this PR still is a breaking change.

@sjrl

sjrl commented Jul 13, 2026

Copy link
Copy Markdown
Contributor Author

To that extent this PR still is a breaking change.

Yes that is correct

@sjrl
sjrl merged commit fb84d45 into main Jul 13, 2026
26 checks passed
@sjrl
sjrl deleted the fix-serde-dataclasses branch July 13, 2026 13:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants