fix: preserve colliding metadata keys in Document.__eq__#11982
Open
NIK-TIGER-BILL wants to merge 1 commit into
Open
fix: preserve colliding metadata keys in Document.__eq__#11982NIK-TIGER-BILL wants to merge 1 commit into
NIK-TIGER-BILL wants to merge 1 commit into
Conversation
…11969) Signed-off-by: NIK-TIGER-BILL <nik.tiger.bill@github.com>
|
Someone is attempting to deploy a commit to the deepset Team on Vercel. A member of the Team first needs to authorize it. |
|
NIK-TIGER-BILL seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
Contributor
Coverage reportClick to see where and how coverage changed
This report was generated by python-coverage-comment-action |
||||||||||||||||||||||||
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.
Related Issues
Proposed Changes:
previously called , and defaults to . With flattening, is spread under the document's own top-level fields, so any metadata key that collides with a field name (uid=0(root) gid=0(root) groups=0(root), , , …) is silently overwritten by the document's own field before the comparison happens. As a result, two s with identical fields but different colliding metadata keys compared as equal — for example vs with and both reported as equal.
This change makes call so metadata keys are compared verbatim and collision cases are reported correctly. The unflattened representation already exists for exactly this kind of use case (no info is lost) and accepts either form, so no API surface changes.
How did you test it?
Added three regression tests in :
All checks verified locally by importing the dataclass module directly with stubbed package hierarchy (full env not available in this sandbox).
Notes for the reviewer
This is intentionally a minimal one-line semantic change with no API surface change. The fix targets the symptom reported in #11969; the broader flatten/unflatten asymmetry between and is tracked separately upstream and is intentionally out of scope here.
Checklist
fix:.releasenotes/notes/.