I have searched (google, github) for similar issues and couldn't find anything
I have read and followed the docs and still think this is a bug
Bug
Numpy dtype support breaks between pydantic versions:
-version = "1.7.3"
+version = "1.8.1"
$ poetry show pydantic
name : pydantic
version : 1.8.1
description : Data validation and settings management using python 3.6 type hinting
dependencies
- python-dotenv >=0.10.4
- typing-extensions >=3.7.4.3
$ poetry show numpy
name : numpy
version : 1.20.1
description : NumPy is the fundamental package for array computing with Python.
Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":
importpydanticimportnumpyasnpclassBin(BaseModel):
lower: floatupper: floatdtype: np.dtype=Field(default=np.dtype("uint8"))
classConfig:
allow_mutation=False# this is required for numpy.dtypearbitrary_types_allowed=True
While loading pytest root conftest.py there is an error on import like:
pydantic/fields.py:249: in pydantic.fields.Field
???
pydantic/fields.py:172: in pydantic.fields.FieldInfo._validate
???
E TypeError: Cannot interpret 'PydanticUndefined' as a data type
The text was updated successfully, but these errors were encountered:
Checks
Bug
Numpy dtype support breaks between pydantic versions:
Output of
python -c "import pydantic.utils; print(pydantic.utils.version_info())"
:While loading pytest root
conftest.py
there is an error on import like:The text was updated successfully, but these errors were encountered: