-
-
Notifications
You must be signed in to change notification settings - Fork 370
Closed
Labels
questionFurther information is requestedFurther information is requested
Description
Question about pandera
I have requirement to validate an integer field that can also be nullable. I also want to use coerce on the pandas dataframe. If field is nullable, then coerce should ignore it when null.
bad request: Error while coercing 'myintegerfield' to type int64: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
"myintegerfield": Column(int, [
Check.ge(0),
Check.le(16)
], nullable=True),
strict=True,
coerce=True,
In the pandera docs:
Note the special case of integers columns not supporting nan values. In this case, schema.validate will complain if coerce == True and null values are allowed in the column.
But pandas is supporting nulls in integers now:
https://pandas.pydata.org/pandas-docs/stable/user_guide/integer_na.html
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested