eltonlaw / impyute

Data imputations library to preprocess datasets with missing data
http://impyute.readthedocs.io/
MIT License
354 stars 49 forks source link

[DDFG] Add BadInputError for dtype handling #66

Open mm-abogdan opened 5 years ago

mm-abogdan commented 5 years ago

In the first case, an UnboundLocalError occurs because data is not assigned based on the current if/else criteria. Add an else clause and raise BadInputError accompanied by a more informative error handling message.

https://github.com/eltonlaw/impyute/blob/2c25368576558374d385293f65c883a91dff5027/impyute/dataset/base.py#L34-L37

In the second case, no matter what value you pass through dtype, no error occurs. This is because, in this instance, data is assigned immediately. Follow the same logic as above.

https://github.com/eltonlaw/impyute/blob/2c25368576558374d385293f65c883a91dff5027/impyute/dataset/base.py#L66-L70

Be sure to follow the 4 steps outlined in contributing.md

The below labels are for DDFG (Data Days for Good) participant reference: Priority: Low Difficulty: Low