Skip to content

Commit e68ee93

Browse files
ignore datetime diffs for different datetime formats
1 parent 33e379d commit e68ee93

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

utils/data_diff.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,15 @@ def diff_obj(obj1: Any, obj2: Any, diff: dict, path: str = "") -> dict:
7474

7575
else:
7676
if obj1 != obj2:
77+
78+
# ignore the case where dates came from 'requests' in +00:00 format
79+
if (
80+
type(obj1) == type(obj2) == str
81+
and obj2.endswith("Z")
82+
and obj1.endswith("+00:00")
83+
):
84+
return diff
85+
7786
diff["changed"][path] = {"old": obj1, "new": obj2}
7887

7988
return diff

0 commit comments

Comments
 (0)