Skip to content

Conversation

@davidhewitt
Copy link
Contributor

Change Summary

Makes creation of a Python date or datetime fail if the year is zero.

Related issue number

Fixes pydantic/pydantic#10967

Checklist

  • Unit tests for the changes exist
  • Documentation reflects the changes where applicable
  • Pydantic tests pass with this pydantic-core (except for expected changes)
  • My PR is ready to review, please add a comment including the phrase "please review" to assign reviewers

@davidhewitt davidhewitt added the backport-2.27 Needs backport to 2.27 label Dec 17, 2024
@codspeed-hq
Copy link

codspeed-hq bot commented Dec 17, 2024

CodSpeed Performance Report

Merging #1583 will not alter performance

Comparing dh/date-ranges (36b1ffd) with main (39435c2)

Summary

✅ 157 untouched benchmarks

Copy link
Contributor

@sydney-runkle sydney-runkle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, tysm!

@davidhewitt davidhewitt merged commit 15adfc7 into main Dec 18, 2024
29 checks passed
@davidhewitt davidhewitt deleted the dh/date-ranges branch December 18, 2024 09:22
@Viicos Viicos changed the title fix ValueError on year zero Fix ValueError on year zero Jan 30, 2025
davidhewitt added a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
davidhewitt added a commit to pydantic/pydantic that referenced this pull request Oct 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-2.27 Needs backport to 2.27

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Date field with year zero will raise ValueError instead of ValidationError

3 participants