Features importance helper issue
Describe the bug
if a UnicodeEncodeError is raised when calling decode_str_or_unicode(), the variable fname will not be defined, and an UnboundLocalError will be raised when trying to append it to the decoded_feature_names list.
To Reproduce
Steps to reproduce the behavior:
Call 'twml/twml/contrib/feature_importances/helpers.py' ' _get_feature_name_from_config' function, with feature name contains characters that cannot be decoded using the default encoding, a UnicodeEncodeError will be raised when calling decode_str_or_unicode(). The function logs this error but does not handle it otherwise, so the feature name variable will not be defined and will raise error in appending step.
Very impressive, did you find out yourself or a tool helped you?
Thanks, Just by reading the function.
Thanks, Just by reading the function.
give this man a job