10000 Support indirect definition references by dmontagu · Pull Request #1130 · pydantic/pydantic-core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support indirect definition references #1130

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 2 commits into from
Dec 21, 2023

Conversation

dmontagu
Copy link
Collaborator
@dmontagu dmontagu commented Dec 21, 2023

This makes certain usage patterns work better in pydantic, e.g., making TypeAliasType references to other TypeAliasType's. I think we may want to optimize out reference chains at some point, but I don't think that should stop us from merging this now since this only makes more schemas acceptable, and doesn't affect any existing use of Pydantic (and the Pydantic PR I will open that makes use of this won't affect any currently-working usage, it will just allow some schemas that currently would raise schema-building errors).

Copy link
codecov bot commented Dec 21, 2023

Codecov Report

Merging #1130 (5468417) into main (bec63db) will increase coverage by 0.04%.
Report is 3 commits behind head on main.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1130      +/-   ##
==========================================
+ Coverage   89.73%   89.78%   +0.04%     
==========================================
  Files         106      106              
  Lines       16380    16429      +49     
  Branches       35       35              
==========================================
+ Hits        14699    14751      +52     
+ Misses       1674     1671       -3     
  Partials        7        7              
Files Coverage Δ
python/pydantic_core/core_schema.py 94.76% <100.00%> (+<0.01%) ⬆️

... and 6 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 bec63db...5468417. Read the comment docs.

Copy link
codspeed-hq bot commented Dec 21, 2023

CodSpeed Performance Report

Merging #1130 will degrade performances by 14.43%

Comparing dmontagu/support-indirect-definition-refs (5468417) with main (2cb87a6)

Summary

⚡ 4 improvements
❌ 1 regressions
✅ 135 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark main dmontagu/support-indirect-definition-refs Change
test_core_future_str 39.6 µs 31.3 µs +26.48%
test_core_str 39 µs 31.5 µs +23.86%
test_core_future 47 µs 54.9 µs -14.43%
test_core_future 37.6 µs 29.1 µs +29.22%
test_positional_tuple 37.1 µs 30.6 µs +21.34%

@adriangb
Copy link
Member

Looks great!

@davidhewitt davidhewitt merged commit 5c896fe into main Dec 21, 2023
@davidhewitt davidhewitt deleted the dmontagu/support-indirect-definition-refs branch December 21, 2023 09:07
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.

3 participants
0