From 11ba482e735365187b1aa5678251eecdf54f4efd Mon Sep 17 00:00:00 2001 From: guille Date: Wed, 31 May 2023 13:53:22 -0400 Subject: [PATCH] correct bug --- hub/helpers/utils.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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)