Skip to content

Conversation

yohanvalencia
Copy link
Contributor

@yohanvalencia yohanvalencia commented Aug 22, 2023

Change Summary

datetime.timedelta error message is now display in a 'human friendly' manner.

Screenshot 2023-08-23 at 01 27 29

Related issue number

fix #882

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

Selected Reviewer: @dmontagu

@codspeed-hq
Copy link

codspeed-hq bot commented Aug 22, 2023

CodSpeed Performance Report

Merging #915 will not alter performance

Comparing yvalencia91:improve-human-readability-timedelta-validation (adef21f) with main (7f7d03d)

Summary

✅ 138 untouched benchmarks

@codecov
Copy link

codecov bot commented Aug 22, 2023

Codecov Report

Merging #915 (adef21f) into main (7f7d03d) will increase coverage by 0.01%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #915      +/-   ##
==========================================
+ Coverage   93.78%   93.79%   +0.01%     
==========================================
  Files         105      105              
  Lines       15331    15364      +33     
  Branches       25       25              
==========================================
+ Hits        14378    14411      +33     
  Misses        947      947              
  Partials        6        6              
Files Changed Coverage Δ
src/validators/timedelta.rs 100.00% <100.00%> (ø)

Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f7d03d...adef21f. Read the comment docs.

@yohanvalencia yohanvalencia changed the title convert datetime error message to human friendly message Convert datetime error message to human friendly message Aug 22, 2023
@yohanvalencia
Copy link
Contributor Author

Please review

Copy link
Member

@adriangb adriangb left a comment

Choose a reason for hiding this comment

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

Looks great to me!

@adriangb adriangb merged commit 15f62b6 into pydantic:main Aug 23, 2023
davidhewitt pushed a commit to pydantic/pydantic that referenced this pull request Oct 20, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Improve error message of timedelta validation

3 participants