Open jpivarski opened 2 years ago
Could you clarify the intention of this Jim? Is it to raise an error if an array has a nominal type but no class is found?
There's a set of errors that occur when we try to do things to a record (ufunc, reducer, ...) that would be possible if the record were overloaded with __record__
but aren't possible for bare records. Currently, we raise an error in these cases, which is correct, but it would be more convenient for downstream libraries if we had a custom exception subclass that is raised in all of these situations, or maybe a suite of them that all inherit from a custom mixin if one needs to be a subclass of ValueError
, another a subclass of TypeError
, etc.
Downstream libraries would then be able to
try:
to_do_a_thing(awkward_array)
except TypeErrorMissingBehavior as err:
err.add_note("You forgot to define a behavior!")
raise
and be able to identify the actual problem more quickly.
OK, sounds like we need a public errors module that exports an exception hierarchy! Added to the todo.
Description of new feature
Prompted by Dask needs (discussion with @martindurant and @douglasdavis), but probably a good idea overall. Losing behaviors is a common type of error and users should get more direct messaging about what (likely) happened.