Skip to content
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

Use new typing syntax for _pydantic_core.pyi #1217

Merged
merged 2 commits into from
Mar 13, 2024

Conversation

Viicos
Copy link
Member

@Viicos Viicos commented Mar 5, 2024

  • future import is assumed by default for stub files
  • it is not necessary to use Python version checks, the convention is to use typing_extensions for objects added in Python>3.8.
  • Removed some unnecessary string references

Copy link

codspeed-hq bot commented Mar 5, 2024

CodSpeed Performance Report

Merging #1217 will improve performances by 35.68%

Comparing Viicos:update-pyi (8cec15c) with main (f669db9)

Summary

⚡ 20 improvements
✅ 128 untouched benchmarks

Benchmarks breakdown

Benchmark main Viicos:update-pyi Change
test_core_future 47.2 µs 41.9 µs +12.52%
test_core_future 29.4 µs 25.8 µs +14.02%
test_core_future_str 26.5 µs 23.4 µs +13.22%
test_date_from_datetime 38.7 µs 34.1 µs +13.57%
test_date_from_str 27.5 µs 23.4 µs +17.75%
test_core_root_model 95 µs 84 µs +13.09%
test_definition_in_tree 4.5 ms 4 ms +12.42%
test_generator_rust 32.8 µs 28.8 µs +13.9%
test_list_of_nullable_core 491.8 µs 408.6 µs +20.35%
test_small_class_core_dict 38.7 µs 28.5 µs +35.68%
test_tuple_many_positional 33.9 µs 30 µs +12.85%
test_tuple_many_variable 33.9 µs 30.1 µs +12.62%
test_validate_literal[json-few_str_enum] 32.8 µs 28.5 µs +15.26%
test_validate_literal[python-few_str_enum] 24.2 µs 21.2 µs +14.31%
test_with_default 41.7 µs 37.2 µs +12.13%
test_core_model_json 50.2 µs 44.3 µs +13.17%
test_dataclass_serialization_json 44.8 µs 40 µs +12.04%
test_dataclass_serialization_python 43.2 µs 38.4 µs +12.52%
test_json_any_list_int 1,034.4 µs 919.1 µs +12.54%
test_to_string_direct 32.3 µs 28.6 µs +12.99%

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.

Thanks! I took the liberty to fix the formatting issues

@davidhewitt davidhewitt enabled auto-merge (squash) March 13, 2024 14:17
Copy link

codecov bot commented Mar 13, 2024

Codecov Report

Merging #1217 (8cec15c) into main (ab503cb) will decrease coverage by 0.33%.
Report is 32 commits behind head on main.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1217      +/-   ##
==========================================
- Coverage   90.21%   89.88%   -0.33%     
==========================================
  Files         106      106              
  Lines       16339    16676     +337     
  Branches       36       40       +4     
==========================================
+ Hits        14740    14990     +250     
- Misses       1592     1667      +75     
- Partials        7       19      +12     

see 53 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 f669db9...8cec15c. Read the comment docs.

@davidhewitt davidhewitt merged commit 9efbc16 into pydantic:main Mar 13, 2024
27 checks passed
@Viicos Viicos deleted the update-pyi branch March 13, 2024 14:22
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