Skip to content

Default int type should be mapped to Int32 in Windows #726

@probberechts

Description

@probberechts

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:

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinghelp wantedExtra attention is needed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions