dotnet / corefxlab

This repo is for experimentation and exploring new ideas that may or may not make it into the main corefx repo.
MIT License
1.46k stars 345 forks source link

Resolves #2902 (Improve loadcsv error experience) #2953

Closed chriss2401 closed 3 years ago

chriss2401 commented 4 years ago

Hi @pgovind and @eerhardt ,

As discussed here is the first out of the two small PR for MDA which resolves #2902. The workaround here is that when Convert.ChangeType does not succeed, we print a descriptive message of which value in which column causes this issue and to which type it cannot be converted. If the type that it was attempted to be converted to was Double or Single, we then assign their corresponding NaN values instead.

I've also added a simple unit test, which tries to trigger this behavior. Please review and comment at your convenience.

Christos.