the-algorithm icon indicating copy to clipboard operation
the-algorithm copied to clipboard

Features importance helper issue

Open khalidamer opened this issue 2 years ago • 3 comments

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.

khalidamer avatar Apr 01 '23 04:04 khalidamer

Very impressive, did you find out yourself or a tool helped you?

ludo6577 avatar Apr 01 '23 04:04 ludo6577

Thanks, Just by reading the function.

khalidamer avatar Apr 01 '23 10:04 khalidamer

Thanks, Just by reading the function.

give this man a job

shyla-marie avatar Apr 03 '23 22:04 shyla-marie