I am trying to set up a DataFrameSchema in Pandera. The catch is that one of the columns of data may be a float or an int, depending on what data source was used to create the dataframe. Is there a way to set up a check on such a column? This code failed:
import pandera as pa
from pandera.typing import DataFrame, Series
from datetime import datetime
import pandas as pd
class IngestSchema(pa.SchemaModel):
column_header: Series[float | int] = pa.Field(alias = 'MY HEADER')
Other things I've tried:
from typing import Union
float_int = Union[float, int]
But pandera does not recognize that union as a datatype. Is there any way to set up such a schema?