Closed cosmicBboy closed 3 years ago
Describe the bug
When using @check_types with a SchemaModel that has coerce=True set as the config, the output dataframe is not coerced to the specified types.
@check_types
SchemaModel
coerce=True
Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
This part of the code is responsible for the bug: https://github.com/pandera-dev/pandera/blob/master/pandera/decorators.py#L502-L509
out
schema.validate
functions specifying a SchemaModel output (where coerce=True) and decorated with check_types should return a dataframe with coerced types.
check_types
fixed by #458
Describe the bug
When using
@check_types
with aSchemaModel
that hascoerce=True
set as the config, the output dataframe is not coerced to the specified types.Note: Please read this guide detailing how to provide the necessary information for us to reproduce your bug.
Code Sample, a copy-pastable example
This part of the code is responsible for the bug: https://github.com/pandera-dev/pandera/blob/master/pandera/decorators.py#L502-L509
out
variable needs to be re-assigned in theschema.validate
call, or it should do an early return in the try-except.Expected behavior
functions specifying a
SchemaModel
output (where coerce=True) and decorated withcheck_types
should return a dataframe with coerced types.