Skip to content
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

DeepDiff result got errors but not raising an exception #461

Open
ikerchev opened this issue May 23, 2024 · 0 comments
Open

DeepDiff result got errors but not raising an exception #461

ikerchev opened this issue May 23, 2024 · 0 comments

Comments

@ikerchev
Copy link

Hello guys, i got an issue when deepdiff didn't raise an exception but just printed errors to the output stream

Can not produce a hash for root['element'].Not counting this object.

So it couldn't compare objects for a reason, but the diff completed successfully and the result was empty when there were really differences between the objects. My program is not reading for errors from the output stream and was just relying on the diff result, so it ended up having unreliable successful result. I cannot reproduce the error message anymore, but if there is a reason for not raising an exception directly, can there be a flag or something that forces failures in case of errors or any other idea how to deal with the scenario? From the diff.py

            except Exception as e:  # pragma: no cover
                logger.error("Can not produce a hash for %s."
                             "Not counting this object.\n %s" %
                             (level.path(), e))

  • OS: Ubuntu
  • Version 22.04.4 LTS
  • Python Version 3.10.12
  • DeepDiff Version 6.3.0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant