mito
mito copied to clipboard
When changing a column datatype, if you have incorrect type data in the column Mito gives a really unhelpful message
Describe the bug When changing a column datatype, if you have the incorrect type data in the column Mito pops up the "Invalid Type Change" modal. The message shows that Mito knows there is an error but does not show you where this is in the column.
As Mito only shows the first 1500 cells, if your error is after that cut off you can only find it by using filtering. As you can see my error is in row 1193, but I knew what I was looking for.
To Reproduce Steps to reproduce the behavior:
-
Create a column of strings, insert numbers, but in one row enter a dash
-
Change the dict to a Pandas dataframe df = pd.DataFrame.from_dict(dict_1)
-
Read the dataframe into Mito mitosheet.sheet(df)
-
Click on str and use the task pane to change from a str to an int and you will receive the error
-
See error
Please include the relevant dataset if the bug you encountered is dataset specific. Make sure to anonymize the data properly. Data I used for my example dict_1 = {'col1': {0: '1', 1: '2', 2: '3', 3: '4', 4: '5', 5: '6', 6: '-', 7: '8', 8: '9', 9: '10' }}
Expected behavior I would like to be pointed to the row where the error occured
Desktop (please complete the following information):
- OS: e.g. Windows 10
- Browser: Chrome
- Mito Version 0.1.388
Additional context Add any other context about the problem here.
@twelsh37 thanks for the bug report! This is certainly not great behavior. It seems like potential solutions here:
- Mito points you to the row (tough, if it is rows > 1500)
- Mito displays all of the failing points
- Mito displays the first failing point
I think (1) requires a bit more architectural changes that we would want. @aarondr77 any thoughts on how you think this sort of error would fit into the app?
As a note - this is the sort of error that seems so much more useful than the traceback (which IMO, will pretty much never be useful to users, given how wrapped it is in Mito's codebase).