Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: skip time truncation for date objects in truncate_datetime#597

Open
SAY-5 wants to merge 1 commit into
qlustered:dev from
SAY-5:fix/truncate-datetime-date
Open

fix: skip time truncation for date objects in truncate_datetime #597
SAY-5 wants to merge 1 commit into
qlustered:dev from
SAY-5:fix/truncate-datetime-date

Conversation

@SAY-5

@SAY-5 SAY-5 commented May 24, 2026

Copy link
Copy Markdown

Fixes #564.

DeepDiff(..., truncate_datetime=...) raised TypeError: 'second' is an invalid keyword argument for replace() when comparing datetime.date values, because datetime_normalize called replace(second=0, ...) on a plain date that has no time component.

A datetime.date (that is not a datetime.datetime) has no time fields, so time truncation is now skipped for it. datetime and time truncation are unchanged. Added a regression test.

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

AltStyle によって変換されたページ (->オリジナル) /