Skip to content

fix: resolve in-place dataclass mutations#10692

Closed
Anandesh-Sharma wants to merge 1 commit intodeepset-ai:mainfrom
Anandesh-Sharma:fix/resolve-dataclass-mutations-10659
Closed

fix: resolve in-place dataclass mutations#10692
Anandesh-Sharma wants to merge 1 commit intodeepset-ai:mainfrom
Anandesh-Sharma:fix/resolve-dataclass-mutations-10659

Conversation

@Anandesh-Sharma
Copy link
Copy Markdown

Summary

  • Replaces in-place dataclass attribute mutations (doc.score = x, stream.mime_type = y, etc.) with dataclasses.replace() across 12 source files
  • Resolves the deprecation warnings introduced by the dataclass mutation detection added in feat: Warn on in-place mutation of dataclass instances #10650
  • Adds a release note documenting the change

Related Issue

Fixes #10659

Changes by file

File Mutation fixed
chat_prompt_builder.py rendered_message._content = [...]
pipeline.py pipeline_snapshot.agent_snapshot = ..., pipeline_snapshot.break_point = ...
file_to_image.py bytestream.mime_type = ...
llm_metadata_extractor.py doc_copy.content = content
link_content.py stream.mime_type = ... (3 places: sync run, sync multi-url, async)
document_joiner.py doc.score = ... (3 methods: _merge, _reciprocal_rank_fusion, _distribution_based_rank_fusion)
hugging_face_tei.py doc_copy.score = ...
meta_field.py document.score = ...
sentence_transformers_similarity.py document.score = score
transformers_similarity.py deduplicated_documents[i].score = ...
extractive.py answer.query = ..., answer.meta = {}, answer.meta.update(...)
in_memory/document_store.py doc.embedding = None

Test plan

  • Existing unit tests should pass (this is a mechanical refactoring that preserves behavior)
  • Verify no new dataclass mutation warnings are emitted in the changed code paths

🤖 Generated with Claude Code

Replace direct attribute mutations on dataclass instances (doc.score = x,
stream.mime_type = y, etc.) with dataclasses.replace() calls across 12
source files. This resolves the deprecation warnings introduced by the
dataclass mutation detection added in PR deepset-ai#10650.

Fixes deepset-ai#10659

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Anandesh-Sharma Anandesh-Sharma requested a review from a team as a code owner February 26, 2026 22:28
@Anandesh-Sharma Anandesh-Sharma requested review from anakin87 and removed request for a team February 26, 2026 22:28
@vercel
Copy link
Copy Markdown

vercel bot commented Feb 26, 2026

@Anandesh-Sharma is attempting to deploy a commit to the deepset Team on Vercel.

A member of the Team first needs to authorize it.

@CLAassistant
Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@anakin87
Copy link
Copy Markdown
Member

@Anandesh-Sharma could you please sign the CLA?

@anakin87
Copy link
Copy Markdown
Member

anakin87 commented Mar 6, 2026

Superseded by #10702

@anakin87 anakin87 closed this Mar 6, 2026
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.

Resolve in-place dataclass mutations

3 participants