DeepDiff Fails to Detect Timezone Changes in Arrays with ignore_order=True #517
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Solution proposal for issue #516
Description
The
deepdiff
library is unable to detect timezone changes in datetimes within arrays.When
ignore_order=True
and a datetime is present within an array,deepdiff
uses an execution path that makes aDeepHash
. Due to the implementation ofdatetime_normalize
, all datetimes have their timezone set to UTC:deepdiff/deepdiff/helper.py
Line 627 in c718369
This behavior causes issues in our use case, as we rely on deepdiff to detect changes in datetime objects, including changes to their timezones.
Changes
Indent logic which replaces timezone to only affect those which has set
truncate_datetime
.Notes
Existing logic was added in commits