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

Computed fields #547

Merged
merged 6 commits into from
Apr 17, 2023
Merged

Computed fields #547

merged 6 commits into from
Apr 17, 2023

Conversation

samuelcolvin
Copy link
Member

@samuelcolvin samuelcolvin commented Apr 14, 2023

Most requested pydantic feature pydantic/pydantic#935

todo:

  • error handling - especially JSON
  • include exclude

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 14, 2023

CodSpeed Performance Report

Merging #547 computed-fields (9c03a5c) will not alter performances.

Summary

🔥 0 improvements
❌ 0 regressions
✅ 97 untouched benchmarks

🆕 16 new benchmarks
⁉️ 8 dropped benchmarks

Benchmarks breakdown

Benchmark main computed-fields Change
🆕 test_validate_literal[python-few_ints] N/A 15.8 µs N/A
🆕 test_validate_literal[python-few_small_strings] N/A 16.1 µs N/A
🆕 test_validate_literal[python-few_large_strings] N/A 16.1 µs N/A
🆕 test_validate_literal[python-few_str_enum] N/A 17.9 µs N/A
🆕 test_validate_literal[python-many_ints] N/A 15.8 µs N/A
🆕 test_validate_literal[python-many_small_strings] N/A 16.1 µs N/A
🆕 test_validate_literal[python-many_large_strings] N/A 16.2 µs N/A
🆕 test_validate_literal[python-few_mixed] N/A 17.9 µs N/A
🆕 test_validate_literal[json-few_ints] N/A 17.9 µs N/A
🆕 test_validate_literal[json-few_small_strings] N/A 22.5 µs N/A
🆕 test_validate_literal[json-few_large_strings] N/A 23.8 µs N/A
🆕 test_validate_literal[json-few_str_enum] N/A 25.5 µs N/A
🆕 test_validate_literal[json-many_ints] N/A 17.9 µs N/A
🆕 test_validate_literal[json-many_small_strings] N/A 22.5 µs N/A
🆕 test_validate_literal[json-many_large_strings] N/A 23.9 µs N/A
🆕 test_validate_literal[json-few_mixed] N/A 20 µs N/A
⁉️ test_validate_literal[few_ints] 16 µs N/A N/A
⁉️ test_validate_literal[few_small_strings] 16.3 µs N/A N/A
⁉️ test_validate_literal[few_large_strings] 16.4 µs N/A N/A
⁉️ test_validate_literal[few_str_enum] 16.4 µs N/A N/A
⁉️ test_validate_literal[many_ints] 16 µs N/A N/A
⁉️ test_validate_literal[many_small_strings] 16.3 µs N/A N/A
⁉️ test_validate_literal[many_large_strings] 16.3 µs N/A N/A
⁉️ test_validate_literal[few_mixed] 34.3 µs N/A N/A

@codecov-commenter
Copy link

codecov-commenter commented Apr 14, 2023

Codecov Report

Merging #547 (0b1859c) into main (2e2bd34) will increase coverage by 0.15%.
The diff coverage is 94.89%.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #547      +/-   ##
==========================================
+ Coverage   93.99%   94.15%   +0.15%     
==========================================
  Files          94       95       +1     
  Lines       12841    12795      -46     
  Branches       24       24              
==========================================
- Hits        12070    12047      -23     
+ Misses        765      742      -23     
  Partials        6        6              
Impacted Files Coverage Δ
src/serializers/mod.rs 98.87% <ø> (ø)
src/serializers/type_serializers/format.rs 93.33% <ø> (ø)
src/serializers/type_serializers/function.rs 95.68% <ø> (ø)
src/serializers/type_serializers/typed_dict.rs 94.80% <85.18%> (-0.59%) ⬇️
src/serializers/computed_fields.rs 96.96% <96.96%> (ø)
pydantic_core/core_schema.py 96.86% <100.00%> (+0.03%) ⬆️
src/serializers/type_serializers/dataclass.rs 100.00% <100.00%> (ø)

... 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 2e2bd34...0b1859c. Read the comment docs.

@samuelcolvin samuelcolvin changed the title implement computed fields Computed fields Apr 14, 2023
@samuelcolvin samuelcolvin enabled auto-merge (squash) April 17, 2023 16:46
@samuelcolvin samuelcolvin merged commit 3c553b7 into main Apr 17, 2023
@samuelcolvin samuelcolvin deleted the computed-fields branch April 17, 2023 16:50
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