learningOrchestra / mlToolKits

learningOrchestra is a distributed Machine Learning integration tool that facilitates and streamlines iterative processes in a Data Science project.
https://learningorchestra.github.io
GNU General Public License v3.0
75 stars 23 forks source link

Missing error handling in Data type microservice #104

Open LaChapeliere opened 3 years ago

LaChapeliere commented 3 years ago

Bug description

I'm not entirely certain because I was not able to test it, but I believe the Data type microservice is missing some error handling in data_type_handler.py For example, if one tries to cast "Hello world" into a float Python will return an error, but there's nothing to catch that error.

Expected result

Either replace the un-castable values by None, or abort the Data type command?

Actual result

Crash?

riibeirogabriel commented 3 years ago

Nop, there are a treatment in each microservice to respond mishandled requests, in this case is returned a bad request error, do you think which is necessary add all response errors in docs?

riibeirogabriel commented 3 years ago

And sorry to respond after 6 days, i didn't see the github notification.

LaChapeliere commented 3 years ago

Nop, there are a treatment in each microservice to respond mishandled requests, in this case is returned a bad request error, do you think which is necessary add all response errors in docs? I think it's not urgent to add the response errors to the docs, but it should be done at some point. Also, the more info you give people in the error message, the better. Does the "bad request error" include a detailed message. In the case I pointed out, you should tell the user that the error is because they tried a cast that's not allowed.

riibeirogabriel commented 3 years ago

when a bad request is accomplished, also is returned a message informating the error with the bad request status (406), in data type handler. There are the "invalid_fields", "invalid_filename" and "missing_fields" messages in DataTypeHandlerRequestValidator class, i think which errors responses already are implemented by each microservices, the user will be informed what is the error in case of bad request.