Changelog#

Versions follow Semantic Versioning (<major>.<minor>.<patch>), but with minor syntax differences to satisfy python package version specifiers.

Until a stable version is released (end of beta), new versions may contain backward-incompatible changes, but we will strive to deprecate features first instead of immediately removal. After that, breaking changes will only be introduced in major versions.

Non-guaranteed behavior

Some aspects is behavior are not guaranteed and could be changed at any release without any mention in the changelog (or even vary in different environments or different runs).

Such details are highlighted in the documentation via this admonition.


3.0.0b5 – 2024-04-20#

Features#

  • Add support for Pydantic models!

    Now you can work with pydantic models like any other: construct from dict, serialize to dict, convert to any other model, and convert it to any other model.

    Also, you can use integrations.pydantic.native_pydantic to delegate loading and dumping to pydantic itself.

  • Add support for dumping Literal inside Union. #237

  • Add support for BytesIO and IO[bytes]. #270

  • Error messages are more obvious.

Breaking Changes#

  • Forbid use of constructs like P[SomeClass].ANY because it is misleading (you have to use P.ANY directly).

  • Private fields (any field starting with underscore) are skipped at dumping. See Private fields dumping for details.


3.0.0b4 – 2024-03-30#

Features#

  • Add coercer for builtin iterables and dict.

  • Models can be automatically converted inside compound types like Optional, list, dict etc.

  • Add conversion.from_param predicate factory to match only parameters

  • An error of loader, dumper, and converter generation contains a much more readable location.

    For example:

    • Linking: `Book.author_ids: list[int] -> BookDTO.author_ids: list[str]`

    • Location: `Stub.f3: memoryview`

Breaking Changes#

  • Now, parameters are automatically linked only to top-level model fields. For manual linking, you can use the new adaptix.conversion.from_param predicate factory.

Bug Fixes#

  • Fix fail to import adaptix package on python 3.8-3.10 when -OO is used.

  • Fix unexpected error on creating coercer between fields with Optional type.

  • Fix unexpected error with type vars getting from UnionType.


3.0.0b3 – 2024-03-08#

Features#

  • conversion.link accepts coercer parameter. #256

  • Add conversion.link_constant to link constant values and constant factories. #258

  • Add coercer for case when source union is subset of destination union (simple == check is using). #242

  • No coercer error now contains type information. #252

  • Add coercer for Optional[S] -> Optional[D] if S is coercible to D. #254

Bug Fixes#

  • Fix SyntaxError with lambda in coercer. #243

  • Model dumping now trying to save the original order of fields inside the dict. #247

  • Fix introspection of sqlalchemy models with column_property (all ColumnElement is ignored excepting Column itself). #250


3.0.0b2 – 2024-02-16#

Features#

  • New major feature is out! Added support for model conversion! Now, you can generate boilerplate converter function by adaptix. See conversion tutorial for details.

  • Basic support for sqlalchemy models are added!

  • Added enum support inside Literal. #178

  • Added flags support.

    Now adaptix has two different ways to process flags: flag_by_exact_value (by default) and flag_by_member_names. #197

  • Added defaultdict support. #216

  • Added support of mapping for enum_by_name provider. #223

  • Created the correct path (fixing python bug) for processing Required and NotRequired with stringified annotations or from __future__ import annotations. #227

Breaking Changes#

  • Due to refactoring of predicate system required for new features:

    1. create_request_checker was renamed to create_loc_stack_checker

    2. RequestPattern (class of P) was renamed to LocStackPattern

    3. method RequestPattern.build_request_checker() was renamed to LocStackPattern.build_loc_stack_checker()

Deprecations#

  • Standardize names inside adaptix.load_error. Import of old names will emit DeprecationWarning.

    Old name

    New name

    MsgError

    MsgLoadError

    ExtraFieldsError

    ExtraFieldsLoadError

    ExtraItemsError

    ExtraItemsLoadError

    NoRequiredFieldsError

    NoRequiredFieldsLoadError

    NoRequiredItemsError

    NoRequiredItemsLoadError

    ValidationError

    ValidationLoadError

    BadVariantError

    BadVariantLoadError

    DatetimeFormatMismatch

    FormatMismatchLoadError

Bug Fixes#

  • Fixed parameter shuffling on skipping optional field. #229


3.0.0b1 – 2023-12-16#

Start of changelog.