-
-
Notifications
You must be signed in to change notification settings - Fork 364
Open
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed
Description
Describe the bug
Pandas handles the default int type differently on Windows and Linux. On Linuxint is interpreted as int64 but on Windows as int32. Since Pandera always maps int to int64, you get unexpected SchemaErrors on Windows. You can read more about it in these issues:
- BUG: Pandas differently interprets
intdtype on Linux/Windows pandas-dev/pandas#44925 - Default int type is platform dependent numpy/numpy#9464
Code Sample
import pandas as pd
import pandera as pa
from pandera.typing import DataFrame, Series
class Schema(pa.SchemaModel):
price: Series[int]
df = pd.DataFrame({ 'price': [8, 12, 10, 16] }).astype(int)
InputSchema.validate(df)This is fine on Linux, but gives a SchemaError: expected series 'price' to have type int64, got int32 on Windows.
DrShushen, chokkoyamada and now-frederik-kress
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workinghelp wantedExtra attention is neededExtra attention is needed