Skip to content

Releases: pydantic/pydantic

v2.9.2 (2024-09-17)

17 Sep 14:59
Compare
Choose a tag to compare

What's Changed

Fixes

Full Changelog: v2.9.1...v2.9.2

v2.9.1 (2024-09-09)

09 Sep 08:35
Compare
Choose a tag to compare

What's Changed

Fixes

Full Changelog: v2.9.0...v2.9.1

v2.9.0 (2024-09-05)

05 Sep 15:40
ed92d0a
Compare
Choose a tag to compare

The code released in v2.9.0 is practically identical to that of v2.9.0b2.

Check out our blog post to learn more about the release highlights!

What's Changed

Packaging

New Features

Changes

Performance

Minor Internal Improvements

  • ⚑️ Speed up multiple_of_validator() by 31% in pydantic/_internal/_validators.py by @misrasaurabh1 in #9839
  • ⚑️ Speed up ModelPrivateAttr.__set_name__() by 18% in pydantic/fields.py by @misrasaurabh1 in #9841
  • ⚑️ Speed up dataclass() by 7% in pydantic/dataclasses.py by @misrasaurabh1 in #9843
  • ⚑️ Speed up function _field_name_for_signature by 37% in pydantic/_internal/_signature.py by @misrasaurabh1 in #9951
  • ⚑️ Speed up method GenerateSchema._unpack_refs_defs by 26% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9949
  • ⚑️ Speed up function apply_each_item_validators by 100% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9950
  • ⚑️ Speed up method ConfigWrapper.core_config by 28% in pydantic/_internal/_config.py by @misrasaurabh1 in #9953

Fixes

  • Respect use_enum_values on Literal types by @kwint in #9787
  • Prevent type error for exotic BaseModel/RootModel inheritance by @dmontagu in #9913
  • Fix typing issue with field_validator-decorated methods by @dmontagu in #9914
  • Replace str type annotation with Any in validator factories in documentation on validators by @maximilianfellhuber in #9885
  • Fix ComputedFieldInfo.wrapped_property pointer when a property setter is assigned by @tlambert03 in #9892
  • Fix recursive typing of main.IncEnx by @tlambert03 in #9924
  • Allow usage of type[Annotated[...]] by @Viicos in #9932
  • mypy plugin: handle frozen fields on a per-field basis by @dmontagu in #9935
  • Fix typo in invalid-annotated-type error code by @sydney-runkle in #9948
  • Simplify schema generation for uuid, url, and ip types by @sydney-runkle in #9975
  • Move date schemas to _generate_schema.py by @sydney-runkle in #9976
  • Move decimal.Decimal validation to _generate_schema.py by @sydney-runkle in #9977
  • Simplify IP address schema in _std_types_schema.py by @sydney-runkle in #9959
  • Fix type annotations for some potentially generic GenerateSchema.match_type options by @sydney-runkle in #9961
  • Add class name to "has conflict" warnings by @msabramo in #9964
  • Fix dataclass ignoring default_factory passed in Annotated by @kc0506 in #9971
  • Fix Sequence ignoring discriminator by @kc0506 in #9980
  • Fix typing for IPvAnyAddress and IPvAnyInterface by @haoyun in #9990
  • Fix false positives on v1 models in mypy plugin for from_orm check requiring from_attributes=True config by @radekwlsk in #9938
  • Apply strict=True to __init__ in mypy plugin by @kc0506 in #9998
  • Refactor application of deque annotations by @sydney-runkle in #10018
  • Raise a better user error when failing to evaluate a forward reference by @Viicos in #10030
  • Fix evaluation of __pydantic_extra__ annotation in specific circumstances by @Viicos in #10070
  • Fix frozen enforcement for dataclasses by @sydney-runkle in #10066
  • Remove logic to handle unused __get_pydantic_core_schema__ signature by @Viicos in #10075
  • Use is_annotated consistently by @Viicos in #10095
  • Fix PydanticDeprecatedSince26 typo by @kc0506 in #10101
  • Improve pyright tests, refactor model decorators signatures by @Viicos in #10092
  • Fix ip serialization logic by @sydney-runkle in #10112
  • Warn when frozen defin...
Read more

v2.9.0b2 (2024-08-30)

31 Aug 01:27
acdd32f
Compare
Choose a tag to compare
v2.9.0b2 (2024-08-30) Pre-release
Pre-release

What's Changed

Packaging

Changes

Performance

Fixes

New Contributors

v2.9.0b1 (2024-08-26)

26 Aug 16:42
714c0df
Compare
Choose a tag to compare
v2.9.0b1 (2024-08-26) Pre-release
Pre-release

What's Changed

Packaging

New Features

Changes

Performance

Minor Internal Improvements

  • ⚑️ Speed up multiple_of_validator() by 31% in pydantic/_internal/_validators.py by @misrasaurabh1 in #9839
  • ⚑️ Speed up ModelPrivateAttr.__set_name__() by 18% in pydantic/fields.py by @misrasaurabh1 in #9841
  • ⚑️ Speed up dataclass() by 7% in pydantic/dataclasses.py by @misrasaurabh1 in #9843
  • ⚑️ Speed up function _field_name_for_signature by 37% in pydantic/_internal/_signature.py by @misrasaurabh1 in #9951
  • ⚑️ Speed up method GenerateSchema._unpack_refs_defs by 26% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9949
  • ⚑️ Speed up function apply_each_item_validators by 100% in pydantic/_internal/_generate_schema.py by @misrasaurabh1 in #9950
  • ⚑️ Speed up method ConfigWrapper.core_config by 28% in pydantic/_internal/_config.py by @misrasaurabh1 in #9953

Fixes

  • Respect use_enum_values on Literal types by @kwint in #9787
  • Prevent type error for exotic BaseModel/RootModel inheritance by @dmontagu in #9913
  • Fix typing issue with field_validator-decorated methods by @dmontagu in #9914
  • Replace str type annotation with Any in validator factories in documentation on validators by @maximilianfellhuber in #9885
  • Fix ComputedFieldInfo.wrapped_property pointer when a property setter is assigned by @tlambert03 in #9892
  • Fix recursive typing of main.IncEnx by @tlambert03 in #9924
  • Allow usage of type[Annotated[...]] by @Viicos in #9932
  • mypy plugin: handle frozen fields on a per-field basis by @dmontagu in #9935
  • Fix typo in invalid-annotated-type error code by @sydney-runkle in #9948
  • Simplify schema generation for uuid, url, and ip types by @sydney-runkle in #9975
  • Move date schemas to _generate_schema.py by @sydney-runkle in #9976
  • Move decimal.Decimal validation to _generate_schema.py by @sydney-runkle in #9977
  • Simplify IP address schema in _std_types_schema.py by @sydney-runkle in #9959
  • Fix type annotations for some potentially generic GenerateSchema.match_type options by @sydney-runkle in #9961
  • Add class name to "has conflict" warnings by @msabramo in #9964
  • Fix dataclass ignoring default_factory passed in Annotated by @kc0506 in #9971
  • Fix Sequence ignoring discriminator by @kc0506 in #9980
  • Fix typing for IPvAnyAddress and IPvAnyInterface by @haoyun in #9990
  • Fix false positives on v1 models in mypy plugin for from_orm check requiring from_attributes=True config by @radekwlsk in #9938
  • Apply strict=True to __init__ in mypy plugin by @kc0506 in #9998
  • Refactor application of deque annotations by @sydney-runkle in #10018
  • Raise a better user error when failing to evaluate a forward reference by @Viicos in #10030
  • Fix evaluation of __pydantic_extra__ annotation in specific circumstances by @Viicos in #10070
  • Fix frozen enforcement for dataclasses by @sydney-runkle in #10066
  • Remove logic to handle unused __get_pydantic_core_schema__ signature by @Viicos in #10075
  • Use is_annotated consistently by @Viicos in #10095
  • Fix PydanticDeprecatedSince26 typo by @kc0506 in #10101
  • Improve pyright tests, refactor model decorators signatures by @Viicos in #10092
  • Fix ip serialization logic by @sydney-runkle in #10112
  • Warn when frozen defined twice for dataclasses by @mochi22 in #10082
  • Do not compute JSON Schema default when plain serializers are used with when_used set to 'json-unless-none' and the default value is None by @Viicos in #10121
  • Fix ImportString special cases by @sydney-runkle in #10137
  • Blacklist default globals to support ex...
Read more

v1.10.18 (2024-08-22)

22 Aug 17:51
5ebcdc1
Compare
Choose a tag to compare

What's Changed

Fixes

New Contributors

Full Changelog: v1.10.17...v1.10.18

v2.8.2 (2024-07-03)

04 Jul 02:47
Compare
Choose a tag to compare

What's Changed

Fixes

  • Fix issue with assertion caused by pluggable schema validator by @dmontagu in #9838

Full Changelog: v2.8.1...v2.8.2

v2.8.1 (2024-07-03)

03 Jul 22:58
Compare
Choose a tag to compare

What's Changed

Packaging

Fixes

New Contributors

Full Changelog: v2.8.0...v2.8.1

v2.8.0 (2024-07-01)

01 Jul 15:44
1609e2a
Compare
Choose a tag to compare

The code released in v2.8.0 is functionally identical to that of v2.8.0b1.

Check out our blog post to learn more about the release highlights!

What's Changed

Packaging

New Features

Changes

  • Add warning when "alias" is set in ignored Annotated field by @nix010 in #9170
  • Support serialization of some serializable defaults in JSON schema by @sydney-runkle in #9624
  • Relax type specification for __validators__ values in create_model by @sydney-runkle in #9697
  • Breaking Change: Improve smart union matching logic by @sydney-runkle in pydantic/pydantic-core#1322
    You can read more about our smart union matching logic here. In some cases, if the old behavior
    is desired, you can switch to left-to-right mode and change the order of your Union members.

Performance

Internal Improvements

  • ⚑️ Speed up _display_error_loc() by 25% in pydantic/v1/error_wrappers.py by @misrasaurabh1 in #9653
  • ⚑️ Speed up _get_all_json_refs() by 34% in pydantic/json_schema.py by @misrasaurabh1 in #9650
  • ⚑️ Speed up is_pydantic_dataclass() by 41% in pydantic/dataclasses.py by @misrasaurabh1 in #9652
  • ⚑️ Speed up to_snake() by 27% in pydantic/alias_generators.py by @misrasaurabh1 in #9747
  • ⚑️ Speed up unwrap_wrapped_function() by 93% in pydantic/_internal/_decorators.py by @misrasaurabh1 in #9727

Fixes

New Contributors

Read more

v2.8.0b1 (2024-06-27)

27 Jun 14:22
764e148
Compare
Choose a tag to compare
v2.8.0b1 (2024-06-27) Pre-release
Pre-release

What's Changed

Packaging

New Features

Changes

  • Add warning when "alias" is set in ignored Annotated field by @nix010 in #9170
  • Support serialization of some serializable defaults in JSON schema by @sydney-runkle in #9624
  • Relax type specification for __validators__ values in create_model by @sydney-runkle in #9697
  • Breaking Change: Improve smart union matching logic by @sydney-runkle in pydantic/pydantic-core#1322
    You can read more about our smart union matching logic here. In some cases, if the old behavior
    is desired, you can switch to left-to-right mode and change the order of your Union members.

Performance

Internal Improvements

  • ⚑️ Speed up _display_error_loc() by 25% in pydantic/v1/error_wrappers.py by @misrasaurabh1 in #9653
  • ⚑️ Speed up _get_all_json_refs() by 34% in pydantic/json_schema.py by @misrasaurabh1 in #9650
  • ⚑️ Speed up is_pydantic_dataclass() by 41% in pydantic/dataclasses.py by @misrasaurabh1 in #9652
  • ⚑️ Speed up to_snake() by 27% in pydantic/alias_generators.py by @misrasaurabh1 in #9747
  • ⚑️ Speed up unwrap_wrapped_function() by 93% in pydantic/_internal/_decorators.py by @misrasaurabh1 in #9727

Fixes

New Contributors

Read more