| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
DeepDiff(..., truncate_datetime=...) raised TypeError for datetime.date
values ('replace() got an unexpected keyword argument microsecond') and
AttributeError for datetime.timedelta values, because datetime_normalize
applied the truncation unconditionally to every value routed through it.
date has no time components to truncate and timedelta has no replace(),
so the truncation is now applied only to datetime and time objects.
Truncation of datetime/time values is unchanged.
Fixes qlustered#564
|
⚠️ Please install the Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## master #617 +/- ##
=======================================
Coverage 95.10% 95.10%
=======================================
Files 17 17
Lines 4900 4900
=======================================
Hits 4660 4660
Misses 240 240 ☔ View full report in Codecov by Harness.
|
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Fixes #564
datetime_normalize applied truncate_datetime to every value routed through it, so DeepDiff(..., truncate_datetime=...) raised TypeError: replace() got an unexpected keyword argument 'microsecond' for datetime.date values and AttributeError for datetime.timedelta values. date has no sub-day components to truncate and timedelta has no replace(), so the truncation is now applied only to datetime and time objects; truncation of those is unchanged.
Regression test added in tests/test_diff_datetime.py: it fails on master with the reported TypeError and passes with the fix.
This change was prepared with AI assistance; the regression test was run locally and fails without the fix.