-
-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
exclude_obj_callback excludes when the condition is true for one variable #315
Comments
If we put AND and the result shows up, I think it is gonna feel more like a bug than the current behavior, no?
We may have to introduce a new parameter that people can define whether it should be AND or OR.
Sep Dehpour
… On May 14, 2022, at 11:11 AM, Mikhail ***@***.***> wrote:
def func(obj, path):
return True if isinstance(obj, int) else False
t1 = {"x": "12"}
t2 = {"x": 1}
print(DeepDiff(t1, t2, exclude_obj_callback=func))
return
{}
func returns True only for t2, but exclude_obj_callback excludes objects from the result. Is this a bug or a feature?
Maybe need to use AND instead of OR here: https://github.com/seperman/deepdiff/blob/9b70b2b5f17e345cb00aef74db7169b53f0c22e8/deepdiff/diff.py#L430 ?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.
|
I mean if we have a reference element with which we will compare other elements, then we will not validate other elements, we will always get True because of the reference element in fact, I don't quite understand in which cases we may need specifically OR |
That must have been a mistake. We should make it consistent between diff and hash.
Thanks
Sep Dehpour
… On May 24, 2022, at 3:10 PM, Mikhail ***@***.***> wrote:
@seperman Why in deephash exclude_obj_callback use AND instead OR?:
https://github.com/seperman/deepdiff/blob/81341e2827d083429bcdfb4617cd40e1188bbdb7/deepdiff/deephash.py#L335
also create PR with strict exclude_obj_callback #320
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
return
{}
func returns True only for t2, but exclude_obj_callback excludes objects from the result. Is this a bug or a feature?
Maybe need to use AND instead of OR here:
deepdiff/deepdiff/diff.py
Line 430 in 9b70b2b
The text was updated successfully, but these errors were encountered: