Skip to content

Commit

Permalink
Undo check_type changes
Browse files Browse the repository at this point in the history
  • Loading branch information
IonesioJunior committed Mar 5, 2024
1 parent 9070f63 commit 961e666
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions packages/syft/src/syft/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__}`"
Expand Down Expand Up @@ -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 (
Expand Down
2 changes: 1 addition & 1 deletion packages/syft/src/syft/store/document_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion packages/syft/src/syft/types/syft_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 961e666

Please sign in to comment.