Skip to content

Conversation

@Viicos
Copy link
Member

@Viicos Viicos commented Mar 4, 2025

Change Summary

Fixes pydantic/pydantic#11341, fixes #1608.

I've applied the coercion for decimals and ints as per pydantic/pydantic#11341 (comment), should we extend to others? I'm thinking datetime types as well?

Related issue number

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

@codspeed-hq
Copy link

codspeed-hq bot commented Mar 4, 2025

CodSpeed Performance Report

Merging #1661 will not alter performance

Comparing constraints-coercion (7b3904e) with main (0761adb)

Summary

✅ 157 untouched benchmarks

Copy link
Contributor

@davidhewitt davidhewitt left a comment

Choose a reason for hiding this comment

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

I'm thinking datetime types as well?

Yes, if I recall, datetime types are the last main category where this matters.

@Viicos
Copy link
Member Author

Viicos commented Mar 5, 2025

@davidhewitt I went and did datetime and date, am I missing anything? timedelta has the gx/lx constraints as well, but I'm wondering if we should.

@Viicos Viicos merged commit a6f3972 into main Mar 5, 2025
28 of 29 checks passed
@Viicos Viicos deleted the constraints-coercion branch March 5, 2025 19:35
@davidhewitt
Copy link
Contributor

Think that's good from me, let's wait for user reports to worry about any other cases.

davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
davidhewitt pushed 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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Validation of core schemas Issues with disabled core schema validation

4 participants