You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since 8.5.6+, an attempt to call class_schema on a class that cannot be converted by marschmallow_dataclass throws AttributeError. Previously it was a TypeError which is somehow meaningful because the type is not convertible.
Example:
from marshmallow_dataclass import class_schema
from typing import Callable
class NonDataClass:
f: Callable[[str, str], int]
class_schema(NonDataClass)
Expected (was in versions up to 8.5.5):
throws TypeError as
TypeError: typing.Callable[[str, str], int] is not a dataclass and cannot be turned into one.
Actual (version 8.5.6, 8.5.7, 8.5.8):
...
File "venv/lib/python3.9/site-packages/marshmallow_dataclass/__init__.py", line 367, in _internal_class_schema
_RECURSION_GUARD.seen_classes[clazz] = clazz.__name__
File ".pyenv/versions/3.9.9/lib/python3.9/typing.py", line 710, in __getattr__
raise AttributeError(attr)
AttributeError: __name__
The text was updated successfully, but these errors were encountered:
antispam2002
changed the title
Incontrovertible classes throw AttributeError
Not convertible classes throw AttributeError
May 2, 2022
Since 8.5.6+, an attempt to call
class_schema
on a class that cannot be converted bymarschmallow_dataclass
throwsAttributeError
. Previously it was aTypeError
which is somehow meaningful because the type is not convertible.Example:
Expected (was in versions up to 8.5.5):
throws TypeError as
Actual (version 8.5.6, 8.5.7, 8.5.8):
The text was updated successfully, but these errors were encountered: