8000 Fix reversal of loc when building errors from Python by adriangb · Pull Request #609 · pydantic/pydantic-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix reversal of loc when building errors from Python #609

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
May 18, 2023

Conversation

adriangb
Copy link
Member
@adriangb adriangb commented May 17, 2023

Fixes #597

Selected Reviewer: @samuelcolvin

@adriangb adriangb requested a review from tiangolo May 17, 2023 17:52
@adriangb
Copy link
Member Author

Please review

Comment on lines +208 to 210
/// Only ever called by ValidationError -> PyLineError to convert user input to our internal Location
/// Thus this expects the location to *not* be reversed and reverses it before storing it.
fn try_from(location: Option<&PyAny>) -> PyResult<Self> {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think if we have things like this that are only ever called from one place it might be best to just implement them in that one place instead of a reusable trait to avoid confusion around this sort of implementation details stemming from how the trait ends up getting used.

@codspeed-hq
Copy link
codspeed-hq bot commented May 17, 2023

CodSpeed Performance Report

Merging #609 fix-loc-reversed (821a097) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 118 untouched benchmarks

🆕 0 new benchmarks
⁉️ 0 dropped benchmarks

@codecov-commenter
Copy link

Codecov Report

Merging #609 (821a097) into main (2a7a2f6) will decrease coverage by 0.13%.
The diff coverage is 100.00%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #609      +/-   ##
==========================================
- Coverage   94.25%   94.13%   -0.13%     
==========================================
  Files          98       98              
  Lines       13188    13189       +1     
  Branches       25       25              
==========================================
- Hits        12430    12415      -15     
- Misses        752      768      +16     
  Partials        6        6              
Impacted Files Coverage Δ
src/errors/location.rs 97.27% <100.00%> (+0.02%) ⬆️

... and 2 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 2a7a2f6...821a097. Read the comment docs.

@adriangb adriangb merged commit c818c3e into main May 18, 2023
@adriangb adriangb deleted the fix-loc-reversed branch May 18, 2023 20:06
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.

ValidationErrors loc seems to be reversed
4 participants
0