Skip to content

Commit

Permalink
Merge branch 'dev' into yash/helm-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
yashgorana authored Mar 2, 2024
2 parents a942cc0 + 1ed779a commit 4b32423
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 15 deletions.
4 changes: 2 additions & 2 deletions packages/syft/setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ syft =
forbiddenfruit==0.1.4
gevent==23.9.1
loguru==0.7.2
networkx==2.8
networkx==3.2.1
packaging>=23.0
pyarrow==14.0.1
# pycapnp is beta version, update to stable version when available
Expand All @@ -45,7 +45,7 @@ syft =
RestrictedPython==7.0
result==0.16.0
tqdm==4.66.1
typeguard==2.13.3
typeguard==4.1.5
typing_extensions==4.8.0
sherlock[redis,filelock]==0.4.1
uvicorn[standard]==0.24.0.post1
Expand Down
8 changes: 4 additions & 4 deletions packages/syft/src/syft/client/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,15 +1002,15 @@ def validate_callable_args_and_kwargs(
if issubclass(v, EmailStr):
v = str
try:
check_type(key, value, v) # raises Exception
check_type(value, v) # raises Exception
success = True
break # only need one to match
except Exception: # nosec
pass
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 @@ -1038,10 +1038,10 @@ def validate_callable_args_and_kwargs(
for v in t.__args__:
if issubclass(v, EmailStr):
v = str
check_type(param_key, arg, v) # raises Exception
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
18 changes: 11 additions & 7 deletions packages/syft/src/syft/types/syft_object.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,9 +450,11 @@ def _repr_markdown_(self, wrap_as_python=True, indent=0) -> str:
value = value.__repr_syft_nested__()
if isinstance(value, list):
value = [
elem.__repr_syft_nested__()
if hasattr(elem, "__repr_syft_nested__")
else elem
(
elem.__repr_syft_nested__()
if hasattr(elem, "__repr_syft_nested__")
else elem
)
for elem in value
]
value = f'"{value}"' if isinstance(value, str) else value
Expand Down Expand Up @@ -564,7 +566,7 @@ def _syft_set_validate_private_attrs_(self, **kwargs):
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 Expand Up @@ -705,9 +707,11 @@ def get_repr_values_table(_self, is_homogenous, extra_fields=None):
and hasattr(value[0], "__repr_syft_nested__")
):
value = [
x.__repr_syft_nested__()
if hasattr(x, "__repr_syft_nested__")
else x
(
x.__repr_syft_nested__()
if hasattr(x, "__repr_syft_nested__")
else x
)
for x in value
]
if value is None:
Expand Down
3 changes: 2 additions & 1 deletion packages/syft/tests/syft/dataset/dataset_stash_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

# third party
import pytest
from typeguard import TypeCheckError

# syft absolute
from syft.service.dataset.dataset import Dataset
Expand Down Expand Up @@ -46,7 +47,7 @@ def test_dataset_actionidpartitionkey() -> None:
ActionIDsPartitionKey.with_obj(obj="dummy_str")

# Not sure what Exception should be raised here, Type or Attibute
with pytest.raises(TypeError):
with pytest.raises(TypeCheckError):
ActionIDsPartitionKey.with_obj(obj=["first_str", "second_str"])


Expand Down

0 comments on commit 4b32423

Please sign in to comment.