impyute icon indicating copy to clipboard operation
impyute copied to clipboard

[DDFG] Add BadInputError for dtype handling

Open mm-abogdan opened this issue 4 years ago • 0 comments

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

mm-abogdan avatar Jul 10 '19 20:07 mm-abogdan