Closed airibarne closed 1 year ago
MyPy gives the following error with a schema containing a Series[BOOL] typed column:
Series[BOOL]
error: Value of type variable "GenericDtype" of "Series" cannot be "BOOL"
from pandera import BOOL, Field, SchemaModel from pandera.typing import Series class MySchema(SchemaModel): """Test schema.""" my_bool: Series[BOOL]
I would expect MyPy not to fail at all.
pip install mypy pandera[mypy]
mypy==0.971 mypy-extensions==0.4.3 numpy==1.23.2 packaging==21.3 pandas==1.4.3 pandas-stubs==1.4.3.220807 pandera==0.12.0 pyarrow==9.0.0 pydantic==1.9.2 pyparsing==3.0.9 python-dateutil==2.8.2 pytz==2022.2.1 six==1.16.0 tomli==2.0.1 types-pytz==2022.2.1.0 typing-extensions==4.3.0 typing-inspect==0.8.0 wrapt==1.14.1
hi @airibarne, I believe this got fixed in https://github.com/unionai-oss/pandera/commit/5f9c713c6a9e3654f23e3c1a24b7ad39a8979e2e
You can update to pandera >= 0.13.0 and this should work.
Description
MyPy gives the following error with a schema containing a
Series[BOOL]
typed column:error: Value of type variable "GenericDtype" of "Series" cannot be "BOOL"
Code Sample
Expected behavior
I would expect MyPy not to fail at all.
Desktop (please complete the following information):
Requeriments
mypy==0.971 mypy-extensions==0.4.3 numpy==1.23.2 packaging==21.3 pandas==1.4.3 pandas-stubs==1.4.3.220807 pandera==0.12.0 pyarrow==9.0.0 pydantic==1.9.2 pyparsing==3.0.9 python-dateutil==2.8.2 pytz==2022.2.1 six==1.16.0 tomli==2.0.1 types-pytz==2022.2.1.0 typing-extensions==4.3.0 typing-inspect==0.8.0 wrapt==1.14.1