Skip to content

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

Description

@cunnane

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)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions