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
After creating a BaseModel subclass and calling update_forward_ref() classmethod, pydantic can modify dict of a module in which the model was created if the model was declared inside some function of this module.
This bug can lead to errors when two different models with the same names are defined in two different test cases or some other errors which can be hard to debug.
The text was updated successfully, but these errors were encountered:
Bug
After creating a BaseModel subclass and calling
update_forward_ref()
classmethod, pydantic can modify dict of a module in which the model was created if the model was declared inside some function of this module.It happens because of these two lines: https://github.com/samuelcolvin/pydantic/blob/645e5fe6a0c74c95c24410571e9bb804af3eb677/pydantic/main.py#L632-L633
They can be fixed that way:
This bug can lead to errors when two different models with the same names are defined in two different test cases or some other errors which can be hard to debug.
The text was updated successfully, but these errors were encountered: