Skip to content

Commit

Permalink
Fix autosplat when it's called from inner services
Browse files Browse the repository at this point in the history
  • Loading branch information
IonesioJunior committed May 20, 2024
1 parent 168ccb9 commit f6cdf0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion packages/syft/src/syft/service/service.py
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,7 @@ def wrapper(func: Any) -> Callable:
_path = class_name + "." + func_name
signature = inspect.signature(func)
signature = signature_remove_self(signature)
signature_with_context = deepcopy(signature)
signature = signature_remove_context(signature)

input_signature = deepcopy(signature)
Expand All @@ -353,7 +354,7 @@ def _decorator(self: Any, *args: Any, **kwargs: Any) -> Callable:
)
if autosplat is not None and len(autosplat) > 0:
args, kwargs = reconstruct_args_kwargs(
signature=input_signature,
signature=signature_with_context,
autosplat=autosplat,
args=args,
kwargs=kwargs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ def allow_guest_signup(

result = method(context=context, settings=settings)

if result.is_err():
if isinstance(result, SyftError):
return SyftError(message=f"Failed to update settings: {result.err()}")

message = "enabled" if enable else "disabled"
Expand Down

0 comments on commit f6cdf0d

Please sign in to comment.