Welcome to cattrs 23.2.0! Thanks to all our wonderful contributors, this release happens to have the largest changelog so far.
Here are some of the noteworthy additions, see below for the entire changelog.
More Powerful Unions in preconf
Courtesy of the union passthrough strategy, the following class (and others like it, this is just a complex example) will work out-of-the-box on any preconf converter:
@define
class MyClass:
my_field: str | Literal[1] | MyOtherClass
The strategy has been preapplied to all preconf converters, but it can be manually applied to any converter.
Default Disambiguation via Literals
When structuring a union of attrs classes, cattrs will default to the default union strategy.
This strategy works by finding required unique fields in the given classes.
It has been enhanced with support for matching on fields annotated as Literals.
Generate unique files only in case of linecache enabled.
(#445#441)
23.2.2 (2023-11-21)
Fix a regression when unstructuring Any | None.
(#453#454)
23.2.1 (2023-11-18)
Fix unnecessary typing_extensions import on Python 3.11.
(#446#447)
23.2.0 (2023-11-17)
Potentially breaking: skip attrs fields marked as init=False by default. This change is potentially breaking for unstructuring.
See here for instructions on how to restore the old behavior.
(#40#395)
Potentially breaking: {py:func}cattrs.gen.make_dict_structure_fn and {py:func}cattrs.gen.typeddicts.make_dict_structure_fn will use the values for the detailed_validation and forbid_extra_keys parameters from the given converter by default now.
If you're using these functions directly, the old behavior can be restored by passing in the desired values directly.
(#410#411)
Potentially breaking: The default union structuring strategy will also use fields annotated as typing.Literal to help guide structuring.
See here for instructions on how to restore the old behavior.
(#391)
Python 3.12 is now supported. Python 3.7 is no longer supported; use older releases there.
(#424)
Implement the union passthrough strategy, enabling much richer union handling for preconfigured converters. Learn more here.
Introduce the use_class_methods strategy. Learn more here.
(#405)
The omit parameter of {py:func}cattrs.override is now of type bool | None (from bool).
None is the new default and means to apply default cattrs handling to the attribute, which is to omit the attribute if it's marked as init=False, and keep it otherwise.
Add support for date to preconfigured converters.
(#420)
Add support for datetime.dates to the PyYAML preconfigured converter.
(#393)
Fix {py:func}format_exception() <cattrs.v.format_exception> parameter working for recursive calls to {py:func}transform_error <cattrs.transform_error>.
(#389)
attrs aliases are now supported, although aliased fields still map to their attribute name instead of their alias by default when un/structuring.
(#322#391)
Added "codecs" feature to separate data models from serialization and work with top-level lists, dataclasses without mixins etc. (#108, #69), see updated documentation
Added new allow_deserialization_not_by_alias config option to allow deserialization by both alias and field name, see documentation (Fatal1ty/mashumaro#175)
Fixed UnserializableDataError for generic serializable types and generic serialization strategies with postponed evaluation of annotations (#177)
Fixed regression when ValueError was not thrown if invalid value type was passed to from_* method
This is a patch release in the 2.1.x series and includes some regression and bug fixes, and a security fix. We recommend that all users upgrade to this version.
See the full whatsnew for a list of all the changes.
The release will be available on the defaults and conda-forge channels:
Thanks to all the contributors who made this release possible.
Pandas 2.1.3
This is a patch release in the 2.1.x series and includes some regression and bug fixes, and a security fix. We recommend that all users upgrade to this version.
See the full whatsnew for a list of all the changes.
The release will be available on the defaults and conda-forge channels:
Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.
Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot show ignore conditions` will show all of the ignore conditions of the specified dependency
- `@dependabot ignore major version` will close this group update PR and stop Dependabot creating any more for the specific dependency's major version (unless you unignore this specific dependency's major version or upgrade to it yourself)
- `@dependabot ignore minor version` will close this group update PR and stop Dependabot creating any more for the specific dependency's minor version (unless you unignore this specific dependency's minor version or upgrade to it yourself)
- `@dependabot ignore ` will close this group update PR and stop Dependabot creating any more for the specific dependency (unless you unignore this specific dependency or upgrade to it yourself)
- `@dependabot unignore ` will remove all of the ignore conditions of the specified dependency
- `@dependabot unignore ` will remove the ignore condition of the specified dependency and ignore conditions
Bumps the benchmark group in /benchmark with 6 updates:
23.1.2
23.2.3
3.10
3.11
3.8.0
3.8.2
2.1.1
2.1.4
2.4.2
2.5.3
0.12.3
0.12.7
Updates
cattrs
from 23.1.2 to 23.2.3Release notes
Sourced from cattrs's releases.
... (truncated)
Changelog
Sourced from cattrs's changelog.
... (truncated)
Commits
5dc43b3
v23.2.33f63212
Flesh out history48cb3d0
Fix unstructuring underspecified generics (#466)88d4758
Optimize linecaching (#464)5b1fa6a
Fix dict value unstructuring (#462)b47f446
Avoid linecache unique file generation in case of linecache disabled (#461)bed932c
v23.2.2281f324
Fix regression (#454)c098cd8
v23.2.125d15d6
Import typing_extensions.TypeAlias only on python < 3.11 (#447)Updates
mashumaro
from 3.10 to 3.11Release notes
Sourced from mashumaro's releases.
Commits
517d8d5
Bump versiond6b7e7e
Update benchmark in READMEd5f98a2
Update benchmarksd526eb4
Update README9b31554
Merge pull request #169 from Fatal1ty/top-level-serializationd1b9d0e
Merge remote-tracking branch 'origin/master' into top-level-serialization0489e8e
Update README2f6ff20
Update README558bd17
Update usage example660b35c
Fix link in READMEUpdates
matplotlib
from 3.8.0 to 3.8.2Release notes
Sourced from matplotlib's releases.
Commits
eb02b10
REL: v3.8.2dfb7a46
Github stats fo v3.8.28023978
Merge branch 'v3.8.1-doc' into v3.8.xacae9bf
Merge pull request #27339 from meeseeksmachine/auto-backport-of-pr-27299-on-v...95743f0
Merge pull request #27338 from meeseeksmachine/auto-backport-of-pr-27334-on-v...cfb494f
Backport PR #27299: [MNT] swap xkcd script for humor sans26fd30a
Backport PR #27334: Omit MOVETO lines from nearest contour logic38a0e94
Merge pull request #27324 from meeseeksmachine/auto-backport-of-pr-27323-on-v...2b58748
Backport PR #27323: [DOC] Minor fixes for savefig-docstring94c0cfe
Merge pull request #27314 from meeseeksmachine/auto-backport-of-pr-27312-on-v...Updates
pandas
from 2.1.1 to 2.1.4Release notes
Sourced from pandas's releases.
Commits
a671b5a
RLS: 2.1.4a741d1e
Backport PR #56393 on branch 2.1.x (DOC: Add release date for 2.1.4) (#56395)23252d0
Revert "debug ci"2a1226b
debug ci99c2756
Backport PR #56160 on branch 2.1.x (BUG: reset_index not preserving object dt...d1764d4
Backport PR #56184 on branch 2.1.x (BUG: mode not preserving object dtype for...aacdf61
Backport PR #56123 on branch 2.1.x (BUG: ne comparison returns False for NA a...7006d99
Backport PR #55703 on branch 2.1.x (Use DeprecationWarning instead of FutureW...65723ab
Backport PR #56174: CI: Add 3.12 builds (#56333)99ab008
Backport PR #56294: BUG: Series(strings, dtype=ArrowDtype[timestamp]) raising...Updates
pydantic
from 2.4.2 to 2.5.3Release notes
Sourced from pydantic's releases.
... (truncated)
Changelog
Sourced from pydantic's changelog.
... (truncated)
Commits
9f58e78
Fix history (#8424)1026268
Add history for 2.5.3 (#8423)888354f
2.5.3 patch release with new pydantic-core (#8420)b75cb28
updating history for patch release based on new core changes365e587
bumping core to 2.14.52033119
Fix:JsonValue
bool
serialization (#8190)34ef158
prep for 2.5.2 release (#8169)25d1197
uprev corecc168a8
AddConfigDict.ser_json_inf_nan
(#8159)01c970b
Fixmodel_validator
example usage code (#8141)Updates
pyserde
from 0.12.3 to 0.12.7Release notes
Sourced from pyserde's releases.
... (truncated)
Commits
b39d881
Merge pull request #454 from yukinarit/update-contributors42d3c5d
:busts_in_silhouette: Add@gschaffner
as a contributord35b932
Merge pull request #452 from gschaffner/fix-skip_if-accidentally-exponentiald6ad066
Fix skip_if causing serialization of a recursive type to be O(2**n) instead o...7119be7
Merge pull request #446 from yukinarit/update-contributorsd19075e
:busts_in_silhouette: Add@maallaire
as a contributoree7edae
Merge pull request #445 from maallaire/fix-iter_types-set63b55e4
Removed List in iter_types if type is Set00b1cfb
Fix test for python3.879433a4
Added test coverage for Set handling with custom serializer/deserializersDependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting
@dependabot rebase
.Dependabot commands and options
You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show