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
Currently, while computing schemas for dataclasses, we keep some thread-local context in _RECURSION_GUARD.seen_classes.
The field_for_schema function does not manage the thread-locals in _RECURSION_GUARD, yet it can (attempt to) use them if called for a type that is or includes a dataclass (or other exotic types). This can cause an exception if field_for_schema is called before the first call to class_schema.
frommarshmallow_dataclassimportfield_for_schemaclassA:
x: intfield_for_schema(A) # => AttributeError("'_thread__local' object has not attribute 'seen_classes'")
This bug is fixed by #214 (currently a work-in-progress).
The text was updated successfully, but these errors were encountered:
Currently, while computing schemas for dataclasses, we keep some thread-local context in
_RECURSION_GUARD.seen_classes
.The
field_for_schema
function does not manage the thread-locals in _RECURSION_GUARD, yet it can (attempt to) use them if called for a type that is or includes a dataclass (or other exotic types). This can cause an exception iffield_for_schema
is called before the first call toclass_schema
.This bug is fixed by #214 (currently a work-in-progress).
The text was updated successfully, but these errors were encountered: