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
When these three conditions are present, importing prisma will generate an error:
A model exists which is named Field.
Another model exists with a Json typed field.
This second model has a field name fields referring to a list of Fields.
In this case, when Pydantic resolves the reference, the model fields are in the local namespace. This causes fields to match the model field instead of the fields module that contains the Json field type.
This is the resulting error:
[...]
File "[...]/python/3.10.13/lib/python3.10/typing.py", line 695, in _evaluate
eval(self.__forward_code__, globalns, localns),
File "<string>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'Json'
Bug description
When these three conditions are present, importing
prisma
will generate an error:Field
.Json
typed field.fields
referring to a list ofField
s.In this case, when Pydantic resolves the reference, the model fields are in the local namespace. This causes
fields
to match the model field instead of the fields module that contains theJson
field type.This is the resulting error:
How to reproduce
prisma
package.Expected behavior
The prisma package should be loaded, no output.
Prisma information
Environment & setup
The text was updated successfully, but these errors were encountered: