Skip to content

Properly truncate characters when splitting up strings in error repr #746

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 3 commits into from
Jul 6, 2023

Conversation

adriangb
Copy link
Member

@adriangb adriangb commented Jul 6, 2023

Fixes pydantic/pydantic#6448

Selected Reviewer: @dmontagu

@adriangb
Copy link
Member Author

adriangb commented Jul 6, 2023

please review

@davidhewitt
Copy link
Contributor

Best not to rely on nightly features now we're in production :)

The implementations of {floor,ceil}_char_boundary are quite small, so I suggest we just copy them into here for now with appropriate credit in a comment.

@adriangb
Copy link
Member Author

adriangb commented Jul 6, 2023

Yep, that’s what I was thinking of doing

@codecov
Copy link

codecov bot commented Jul 6, 2023

Codecov Report

Merging #746 (1396725) into main (4527b80) will increase coverage by 0.00%.
The diff coverage is 95.65%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #746   +/-   ##
=======================================
  Coverage   93.63%   93.63%           
=======================================
  Files          99       99           
  Lines       13895    13917   +22     
  Branches       25       25           
=======================================
+ Hits        13010    13031   +21     
- Misses        879      880    +1     
  Partials        6        6           
Impacted Files Coverage Δ
src/errors/validation_exception.rs 94.01% <95.65%> (+0.09%) ⬆️

... and 4 files with indirect coverage changes


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 4527b80...1396725. Read the comment docs.

@codspeed-hq
Copy link

codspeed-hq bot commented Jul 6, 2023

CodSpeed Performance Report

Merging #746 will improve performances by 10.83%

Comparing fix-unicode (1396725) with main (4527b80)

Summary

🔥 1 improvements
✅ 125 untouched benchmarks

Benchmarks breakdown

Benchmark main fix-unicode Change
🔥 test_complete_core_json 2.8 ms 2.5 ms +10.83%

@adriangb
Copy link
Member Author

adriangb commented Jul 6, 2023

@davidhewitt mind taking a stab at a review since we already discussed this?

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.

👍

@adriangb adriangb merged commit 3a9c162 into main Jul 6, 2023
@adriangb adriangb deleted the fix-unicode branch July 6, 2023 14:30
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.

Panic in validation of nested model with unicode strings
3 participants