-
-
Notifications
You must be signed in to change notification settings - Fork 226
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Error when subtracting Delta from a dictionary #443
Comments
@tpcalhoun This bug is a bug in Delta subtraction and not about converting delta to flat dict list and back. I am looking into it right now. |
The issue is happening because DeepDiff is keeping that path on |
Thank you for your reply. No worries, we figure out a work around. I'm
not at my computer right now, but I can send you more details later about
how we resolved this issue, utilizing deepdiff's existing functionality.
…On Fri, Apr 5, 2024, 5:05 PM Sep Dehpour ***@***.***> wrote:
The issue is happening because DeepDiff is keeping that path on t1. But
when subtracting a delta, it needs the path on t2. It still uses the path
on t1 and thus the results are not expected.
—
Reply to this email directly, view it on GitHub
<#443 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/BER3NTQAZJQVC2FYIJ5CRT3Y34N3RAVCNFSM6AAAAABBEWCNMGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDANBQGY4DQOBQGI>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@tpcalhoun Ok cool. I released DeepDiff 7 and included a test case from this ticket. It needed more work than I anticipated. :) |
Please checkout the F.A.Q page before creating a bug ticket to make sure it is not already addressed.
Describe the bug
An upstream provider sends us a JSON event with 3 sections: beforeImage, updates, allAfterImage. In the near future they will send us only the updates and allAfterImage to save on payload size. We will then attempt to generate the beforeImage on our own by using the allAfterImage and subtracting a Delta created from the updates. Note: we are taking a cautious approach and have chosen to specify the argument raise_errors=True on our Delta. However, in this one circumstance, we see that when we try to generate a beforeImage, the Delta throws an error. Likewise, if we change raise_errors=False then we see that our generated beforeImage does not match what was expected(provided).
To Reproduce
The below code can be used to demonstrate the problem using a Unit Test.
Expected behavior
We would expect to be able to be able to generate a new beforeImage which exactly matches the provided event beforeImage.
OS, DeepDiff version and Python version (please complete the following information):
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: