Skip to content

use timedelta repr as constraint in error messages #747

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 6, 2023

Conversation

davidhewitt
Copy link
Contributor

Change Summary

Changes timedelta validation with constraints to format the constraint as a Python timedelta instead of ISO duration. Most users are likely more familiar with the Python representation.

Related issue number

Ref pydantic/pydantic#6421

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 Jul 6, 2023

CodSpeed Performance Report

Merging #747 will improve performances by 10.38%

Comparing dh/timedelta-constraint (0b5891d) with main (ce68729)

Summary

🔥 1 improvements
✅ 125 untouched benchmarks

Benchmarks breakdown

Benchmark main dh/timedelta-constraint Change
🔥 test_complete_core_json 2.8 ms 2.6 ms +10.38%

@davidhewitt davidhewitt merged commit 6666073 into main Jul 6, 2023
@davidhewitt davidhewitt deleted the dh/timedelta-constraint branch July 6, 2023 13:58
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.

2 participants