Releases: reagento/adaptix
v3.0.0b11 — Redesigned error rendering
-
Completely redesigned error rendering system. All errors related to loader, dumper, and converter generation now utilize a new compact and intuitive display format. Error messages have also been substantially improved for clarity.
Old error:
| adaptix.AggregateCannotProvide: Cannot create loader for model. Loaders for some fields cannot be created (1 sub-exception) | Location: `Book` +-+---------------- 1 ---------------- | adaptix.AggregateCannotProvide: Cannot create loader for model. Cannot fetch InputNameLayout (1 sub-exception) | Location: `Book.author: Person` +-+---------------- 1 ---------------- | adaptix.CannotProvide: Required fields ['last_name'] are skipped | Location: `Book.author: Person` +------------------------------------ The above exception was the direct cause of the following exception: Traceback (most recent call last): ... adaptix.ProviderNotFoundError: Cannot produce loader for type <class '__main__.Book'> Note: The attached exception above contains verbose description of the problemNew error:
Traceback (most recent call last): ... adaptix.ProviderNotFoundError: Cannot produce loader for type <class '__main__.Book'> × Cannot create loader for model. Loaders for some fields cannot be created │ Location: ‹Book› ╰──▷ Cannot create loader for model. Cannot fetch `InputNameLayout` │ Location: ‹Book.author: Person› ╰──▷ Required fields ['last_name'] are skipped -
Fix some nasty bugs with parametrized Pydantic models and parametrized TypeAlias
-
Minor backwards incompatible changes
See the full list of changes at changelog.
v3.0.0b10 — msgpec support
-
Add support for msgspec models!
Now you can work with msgspec models like any other: construct from a dict, serialize to a dict, and convert it into any other model.
This allows you to combine the flexibility of adaptix with the incredible speed of msgspec
-
A completely new algorithm for model dumper code generation has been implemented.
Dumping models with default values is now faster. For GitHub Issues models, which include only a few default fields, dump time has been reduced by 22%.
-
You can now easily distinguish between a missing field and a field set to None. See new article for details
See the full list of changes at changelog.
v3.0.0b9 — Python 3.13 support
- Add support for all Python 3.13 new features.
- Add Why not Pydantic? article.
- All iterables now are dumped to tuple (or list for list children).
See the full list of changes at changelog.
v3.0.0b8 — Generation optimization
- New providers for working with time:
datetime_by_timestamp,date_by_timestampanddatetime_by_format. - Add
exec_type_checkingfunction to deal with cyclic references by executingif TYPE_CHECKING:constructs. - Add support for bytes inside literal, for example
Literal[b"abc"]. - The library shows a hint if one class is a model and the other is not.
- Traceback of CannotProvide is hidden (it is raised when loader, dumper, or converter can not be created). It simplifies error messages to users. You can show traceback by disabling hide_traceback parameter of Retort.
- Drop support of Python 3.8.
- Refactor internal provider routing system. It becomes more simple and readable. Also, internal caching is added. This led to a 40% speedup in loader generation for medium models and up to 4x speedup for large models with many recursive types.
See the full list of changes at changelog.
v3.0.0b7 — Important fixes
- Allow redefining coercer inside
Optionalusing an inner type if source and destination types are same. - Fix ForwardRef evaluation inside
__bound__ofTypeVarforPython 3.12.4. NoSuitableProviderexception was renamed toProviderNotFoundError(old name is available as alias).
See the full list of changes at changelog.
v3.0.0b6 — Linking several fields
-
Now, you can merge several fields or access the model directly via conversion.link_function.
See Link function for details. -
Add a special column type for serializing and deserializing JSON inside SQLAlchemy.
See SQLAlchemy JSON for details. -
Add
Extended Usagearticle for model conversion and other documentation updates.
See the full list of changes at changelog.
v3.0.0b5 — Pydantic support
-
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
LiteralinsideUnion. #237 -
Add support for
BytesIOandIO[bytes]. #270
See the full list of changes at changelog.
v3.0.0b4 — model conversion inside compound types
- Models can be automatically converted inside compound types like Optional, list, dict etc.
- An error of loader, dumper, and converter generation contains a much more readable location
- Add coercer for builtin iterables and dict.
See the full list of changes at changelog.
v3.0.0b3 — enhancing model conversion
- Coercer can be added directly inside the link.
- Added ability to link constant values and factories.
- Better errors that the coercer was not found.
- More automatic do-nothing coercion detection
See the full list of changes at changelog.
v3.0.0b2 — model conversion and sqlalchemy support
- 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.
- Added flags support.
- Added defaultdict support.
See full list of changes at changelog.