From 961e666b7410ac5b6896a551afbd62e0024c8b3e Mon Sep 17 00:00:00 2001 From: Ionesio Junior Date: Tue, 5 Mar 2024 16:50:53 -0300 Subject: [PATCH] Undo check_type changes --- packages/syft/src/syft/client/api.py | 4 ++-- packages/syft/src/syft/store/document_store.py | 2 +- packages/syft/src/syft/types/syft_object.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/syft/src/syft/client/api.py b/packages/syft/src/syft/client/api.py index 951ef7fb0f1..5821550b2b9 100644 --- a/packages/syft/src/syft/client/api.py +++ b/packages/syft/src/syft/client/api.py @@ -1025,7 +1025,7 @@ def validate_callable_args_and_kwargs( if not success: raise TypeError() else: - check_type(key, value, t) # raises Exception + check_type(value, t) # raises Exception except TypeError: _type_str = getattr(t, "__name__", str(t)) msg = f"`{key}` must be of type `{_type_str}` not `{type(value).__name__}`" @@ -1056,7 +1056,7 @@ def validate_callable_args_and_kwargs( check_type(arg, v) # raises Exception break # only need one to match else: - check_type(param_key, arg, t) # raises Exception + check_type(arg, t) # raises Exception except TypeError: t_arg = type(arg) if ( diff --git a/packages/syft/src/syft/store/document_store.py b/packages/syft/src/syft/store/document_store.py index 242abb23782..d56b9434471 100644 --- a/packages/syft/src/syft/store/document_store.py +++ b/packages/syft/src/syft/store/document_store.py @@ -104,7 +104,7 @@ def extract_list(self, obj: Any) -> List: obj = [obj] # is a list type so lets compare directly - check_type("obj", obj, self.type_) + check_type(obj, self.type_) return obj @property diff --git a/packages/syft/src/syft/types/syft_object.py b/packages/syft/src/syft/types/syft_object.py index 679f3346a98..d8a00ca084d 100644 --- a/packages/syft/src/syft/types/syft_object.py +++ b/packages/syft/src/syft/types/syft_object.py @@ -587,7 +587,7 @@ def _syft_set_validate_private_attrs_(self, **kwargs: Any) -> None: value = decl.default_factory(value) elif var_annotation is not None: # Otherwise validate value against the variable annotation - check_type(attr, value, var_annotation) + check_type(value, var_annotation) setattr(self, attr, value) else: # check if the private is optional