diff --git a/hub/helpers/utils.py b/hub/helpers/utils.py index 49fc982b..6149ecf0 100644 --- a/hub/helpers/utils.py +++ b/hub/helpers/utils.py @@ -15,10 +15,8 @@ def validate_import_export_type(cls_name: type, handler: str): :param handler: import export handler :return: None """ - functions = [ - function[1:] for function in dir(cls_name) - if type(getattr(cls_name, function)) in (property, callable(getattr(cls_name, function))) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__' - ] + functions = [function[1:] for function in dir(cls_name) if (type(getattr(cls_name, function)) is property or callable(getattr(cls_name, function))) and function in cls_name.__dict__ and function[0] == '_' and function != '__init__'] + if handler.lower() not in functions: error_message = f'Wrong import type [{handler}]. Valid functions include {functions}' logging.error(error_message)