test(qdrant): replace in-place Document mutations with dataclasses.replace()#3180
Closed
Aftabbs wants to merge 1 commit intodeepset-ai:mainfrom
Closed
test(qdrant): replace in-place Document mutations with dataclasses.replace()#3180Aftabbs wants to merge 1 commit intodeepset-ai:mainfrom
Aftabbs wants to merge 1 commit intodeepset-ai:mainfrom
Conversation
Contributor
bogdankostic
requested changes
Apr 20, 2026
Contributor
bogdankostic
left a comment
There was a problem hiding this comment.
Thanks for your PR @Aftabbs! I added a comment about reverting the changes made to CHANGELOG.md - otherwise the PR already looks good.
Contributor
There was a problem hiding this comment.
Please revert the changes made here, the Changelog is generated automatically whenever we release a new version.
Member
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.
Summary
partially addresses deepset-ai/haystack#11084 (partial — Qdrant).
After the in-place mutation warning was added to
Documentin deepset-ai/haystack#10650, four tests inQdrantSparseEmbeddingRetrieverIntegrationtriggerDeprecationWarningby mutatingDocument.sparse_embeddingandDocument.metadirectly after construction.Affected tests and mutations:
test_rundoc.sparse_embeddingtest_run_with_group_bydoc.sparse_embedding,doc.metatest_run_asyncdoc.sparse_embeddingtest_run_with_group_by_asyncdoc.sparse_embedding,doc.metaFix: replace all for-loop field assignments with
dataclasses.replace()list comprehensions:Test plan
pytest -m "integration" integrations/qdrant/tests/test_sparse_embedding_retriever.py— should pass with zeroDeprecationWarningabout in-place mutations