]> git.ipfire.org Git - thirdparty/sqlalchemy/sqlalchemy.git/commit
Wrap dataclass exceptions clarifying origin
authorFederico Caselli <cfederico87@gmail.com>
Wed, 29 Mar 2023 22:25:39 +0000 (00:25 +0200)
committerMike Bayer <mike_mp@zzzcomputing.com>
Fri, 31 Mar 2023 13:57:09 +0000 (09:57 -0400)
commit96670516b917424e7dd4c6cee5e07147c583f6c9
tree50e53530f33859228b989d03228f6da14449c5b1
parentdb69e680da3aa01572c19cdedb6448e74a01c790
Wrap dataclass exceptions clarifying origin

Exceptions such as ``TypeError`` and ``ValueError`` raised by Python
dataclasses when making use of the :class:`_orm.MappedAsDataclass` mixin
class or :meth:`_orm.registry.mapped_as_dataclass` decorator are now
wrapped within an :class:`.InvalidRequestError` wrapper along with
informative context about the error message, referring to the Python
dataclasses documentation as the authoritative source of background
information on the cause of the exception.

Fixes: #9563
Change-Id: I25652485b91c4ee8cf112b91aae8f9041061a8bd
doc/build/changelog/unreleased_20/9563.rst [new file with mode: 0644]
doc/build/errors.rst
lib/sqlalchemy/orm/decl_base.py
test/orm/declarative/test_dc_transforms.py