Open aartaria opened 2 years ago
thanks for reporting this @aartaria, this is definitely a bug!
don't exactly remember now why that to_numpy
call is there, can you see which unit tests fail if you remove it? I have a suspicion it's there for the sake of supporting the pandas-like frameworks (pyspark.pandas, modin, or dask) but yeah ideally that wouldn't need to be called
https://github.com/unionai-oss/pandera/pull/856 fixed this apparantly, but just gonna keep this open, since #856 didn't add unit tests for the changes
Validation for an index of type "category" fails starting from version
0.8.0
Minimal reproducible example
Where it fails Here https://github.com/pandera-dev/pandera/blob/9a463e1757e2811bbfee4684562541a5f2110cc3/pandera/schema_components.py#L385-L387 the index gets converted to a numpy array but Categorical is not a numpy array and therefore validation fails
removing the numpy conversion lets the validation pass, but I do not know what else it would/could influence