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.
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.
In the first case, an
UnboundLocalError
occurs becausedata
is not assigned based on the currentif/else
criteria. Add anelse
clause andraise 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