Highlights
As of this release, Pydantic is an optional dependency.
What does that mean?
For you as an end user, not much; It is still supported in the same capacity as before, it's just not required anymore.
We have migrated all of our internals that previously relied on Pydantic (mainly for parsing and validation) to the amazing msgspec library, with Pydantic now being handled by an internal plugin.
The important thing is: Everything that has worked before with Pydantic will continue to work, and if you're not using Pydantic, but instead want to use attrs or pure msgspec, you won't have a required Pydantic dependency anymore.
Pydantic 2 support
Another change related to Pydantic is that this release adds support for Pydantic 2, which offers lots of improvements, new features and performance gains. Pydantic 1 is still fully supported and will be for the foreseeable future.
What's Changed
New features
- DTO: Support piccolo ORM with
PiccoloDTO
by @Goldziher in #1896 - DTO: Add
include
option toDTOConfig
by @Goldziher in #1950 - SQLAlchemyDTO: column/relationship type inference by @peterschutt in #1879
- SQLAlchemy repository: New
auto_commit
,auto_refresh
andauto_expunge
options by @cofin in #1900 - Allow customization of
OpenAPIController.path
fromOpenAPIConfig
by @jaykv in #1886 - Include path name in
ImproperlyConfiguredException
message for missing param type by @euri10 in #1935
Bugfixes
- Breaking SQLAlchemy repository: Fix spanner support by renaming the
_sentinel
column tosa_orm_sentinel
by @cofin in #1933 - SQLAlchemy repository: Fix audit columns
created_at
andupdated_at
defaulting to app startup time by @MatthewNewland in #1894 - SQLAlchemyDTO: Fix handling of
Sequence
with defaults by @peterschutt in #1883 - DTO / OpenAPI: Fix detection of required fields for Pydantic and msgspec by @abdulhaq-e in #1946
- Allow JSON as redirect response by @cofin in #1908
Other changes
- Breaking Pin Redis to
>=4.4.4+
version by @Goldziher in #1903 - Breaking Replace
Header
,CacheControlHeader
andETag
Pydantic models with dataclasses by @Tsdevendra1 in #1917 - Breaking
dto.factory.abc.AbstractDTOFactory
moved todto.factory.base.AbstractDTOFactory
by @Goldziher in #1950 - Breaking Make Pydantic an optional extra by @Goldziher in #1963
- Pydantic 2 support by @Goldziher in #1956
- Deprecation of
partial
module by @Goldziher in #2002
New Contributors
- @jaykv made their first contribution in #1886
- @Tsdevendra1 made their first contribution in #1917
- @euri10 made their first contribution in #1935
- @su-shubham made their first contribution in #1930
- @erik-hasse made their first contribution in #1938
- @sobolevn made their first contribution in #1954
Full Changelog: v2.0.0beta2...v2.0.0beta3