You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Expected behavior
It produces a hash value for the datetime64.
OS, DeepDiff version and Python version (please complete the following information):
OS: MacOS
Version: Darwin Darwin Kernel Version 23.6.0: Fri Jul 5 17:55:37 PDT 2024; root:xnu-10063.141.1~2/RELEASE_ARM64_T6030 arm64
Python Version: 3.12.8
DeepDiff Version: 8.4.2
Numpy Version: 2.2.4
Additional context
It looks like there's some other stuff in deepdiff.helper that might be relevant. For instance, the datetimes tuple also doesn't have numpy.datetime64, but adding it there seems unnecessary to fix this issue. It looks like the only use of datetimes is to add to the numbers tuple, and I'm not sure whether this should be considered a number.
The text was updated successfully, but these errors were encountered:
Hi @jcipar
Thanks for the detailed explanation. Do you want to make a PR? You can then add yourself to the contributors list too. And please include unit tests.
We do check for isinstance(obj, datetimes) btw and convert datetimes to proper timezone for comparison.
Sounds good, I can have something ready shortly. I'm not sure where you'd prefer the tests for diffing. It seems like both test_diff_numpy and test_diff_datetime would make sense.
jcipar
added a commit
to jcipar/deepdiff
that referenced
this issue
Mar 29, 2025
Describe the bug
When hashing a
numpy.datetime64
deepdiff.DeepHash fails withRecursionError: maximum recursion depth exceeded
.This can be fixed by adding
numpy.datetime64
todeepdiff.helper.times
.To Reproduce
This is a test case that demonstrates the problem:
This is a monkeypatch that I'm using to work around the problem:
Expected behavior
It produces a hash value for the datetime64.
OS, DeepDiff version and Python version (please complete the following information):
Additional context
It looks like there's some other stuff in
deepdiff.helper
that might be relevant. For instance, thedatetimes
tuple also doesn't havenumpy.datetime64
, but adding it there seems unnecessary to fix this issue. It looks like the only use ofdatetimes
is to add to thenumbers
tuple, and I'm not sure whether this should be considered a number.The text was updated successfully, but these errors were encountered: