forte icon indicating copy to clipboard operation
forte copied to clipboard

More descriptive error message when the data pack contains unknown types

Open hunterhector opened this issue 4 years ago • 0 comments

Is your feature request related to a problem? Please describe. When the serialized data pack contains an unknown type, the Forte system will not serialize it as a class but as a plain dictionary instead. This will produce errors with confusing messages. For example, the following error would occur when the system trying to sort the entries.

"lib/python3.7/site-packages/sortedcontainers/sortedlist.py", line 168, in __init__
    self._update(iterable)
  File "lib/python3.7/site-packages/sortedcontainers/sortedlist.py", line 335, in update
    values = sorted(iterable)
TypeError: '<' not supported between instances of 'dict' and 'dict'

Describe the solution you'd like This can be caught earlier in the code, say after the serialization. It can check whether the data pack contains some pure Dict instances in the entry lists. And then report error right away with clear messages saying "the_unknown_type" is not found.

Describe alternatives you've considered The system can remove the element from the list and continue processing (if a lenient parameter is set to true.). This is definitely a more involved process.

Additional context Add any other context or screenshots about the feature request here.

hunterhector avatar Mar 05 '21 17:03 hunterhector