unionai-oss / pandera

A light-weight, flexible, and expressive statistical data testing library
https://www.union.ai/pandera
MIT License
3.27k stars 305 forks source link

check_types decorator output doesn't coerce #457

Closed cosmicBboy closed 3 years ago

cosmicBboy commented 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.

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

Expected behavior

functions specifying a SchemaModel output (where coerce=True) and decorated with check_types should return a dataframe with coerced types.

cosmicBboy commented 3 years ago

fixed by #458