deepdiff icon indicating copy to clipboard operation
deepdiff copied to clipboard

Error `datetime doesn't define __round__ method` when datetime used as dict key with some of of the `ignore_...` flags

Open cunnane opened this issue 6 months ago • 0 comments

Receive error datetime doesn't define __round__ method when datetime is used as dict key and ignore_numeric_type_changes or ignore_string_case or ignore_string_type_changes is specified.

To Reproduce

import datetime
from deepdiff import DeepDiff
d1 = {datetime.datetime(2020, 5, 17, 22, 15): 10.0}
d2 = {datetime.datetime(2020, 5, 17, 22, 15): 10}
DeepDiff(d1, d2, ignore_numeric_type_changes=True)

Expected behavior Output an empty dict

  • OS: Windows
  • Version Latest
  • Python Version 3.11
  • DeepDiff Version 8.5.0 to 7.0.1 (have not checked others)

cunnane avatar May 23 '25 12:05 cunnane