-
-
Notifications
You must be signed in to change notification settings - Fork 404
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve exceptions on data interface constructor #1127
Comments
We probably need some logic in the section of the code where the different data interfaces are tried out to retain this information. Maybe we could keep this info on a hidden class attribute where you can see the exception and traceback for each interface tested. Alternatively, maybe we could show the real exception but only if the length of the data interface list is one. Having only one possible interface to try means there is no ambiguity about which interface should be used which means any exceptions and tracebacks generated should be shown - this seems like sensible behavior to implement whether or not we do anything else. |
I have a new suggestion, how about when the data is one of the expected formats and all the interfaces fail to interpret the data it raises the exception for the prioritized interface, e.g. when passing in an xarray.Dataset you see the exception raised by the XArrayInterface and the same happens for dataframes, dictionaries, arrays and iris cubes. In case of passing in a list or tuple you still wouldn't see an error but at least the unambiguous data types could raise meaningful exceptions. |
You mean you see the traceback from the interface that recognized the type/format but failed in some other way? What do you mean by ' prioritized interface'? |
Right. |
Ok, in that case I have two questions:
|
I've introduced |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Currently we generate a fairly useless exception message if no interface is able to process the data:
There's a fairly good reason to have done this because we don't want to see exceptions from all the interfaces it tries, but when you're trying to debug what has gone wrong this output is just entirely unhelpful. We should find some way to summarize and report the exceptions raised by the individual interfaces.
The text was updated successfully, but these errors were encountered: