Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Refactor] Fixing mypy issues for syft/service/ and syft/util/ #8492

Merged
merged 53 commits into from
Feb 28, 2024

Conversation

khoaguin
Copy link
Member

@khoaguin khoaguin commented Feb 15, 2024

Fix mypy issues for syft/service and syft/util directories

@khoaguin khoaguin changed the title [Refactor] Fixing mypy issues for syft/service/ dir [Refactor] Fixing mypy issues for syft/service/ and syft/util/ Feb 15, 2024
@khoaguin khoaguin requested a review from kiendang February 16, 2024 09:23
Make _func_or_class positional-only in instrument
Make noop accept additional arbitrary args and kwargs
@khoaguin khoaguin force-pushed the fix-mypy-issues-service-dir branch from 947b2a4 to beab7ca Compare February 26, 2024 10:35
packages/syft/src/syft/service/action/action_object.py Outdated Show resolved Hide resolved
packages/syft/src/syft/service/action/action_object.py Outdated Show resolved Hide resolved
packages/syft/src/syft/service/action/action_service.py Outdated Show resolved Hide resolved
packages/syft/src/syft/service/action/action_service.py Outdated Show resolved Hide resolved
def input_owner_verify_keys(self) -> Optional[List[SyftVerifyKey]]:
if self.input_policy_init_kwargs is not None:
return [x.verify_key for x in self.input_policy_init_kwargs.keys()]
return None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can skip returning None, its the default behaviour with no return types.

packages/syft/src/syft/service/code/user_code.py Outdated Show resolved Hide resolved
@@ -914,7 +915,7 @@ def _syft_try_to_save_to_store(self, obj) -> None:
)

if api is not None:
TraceResult.result += [action]
TraceResult.result += [action] # type: ignore[unreachable]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by: dd52fb2


if api is not None:
obj._set_obj_location_(api.node_uid, api.signing_key.verify_key)
obj._set_obj_location_(api.node_uid, api.signing_key.verify_key) # type: ignore[unreachable]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed by: dd52fb2

Copy link
Member

@shubham3121 shubham3121 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@khoaguin this is tremendous work !! 🦾 💯

@khoaguin khoaguin enabled auto-merge February 28, 2024 16:17
@khoaguin khoaguin merged commit ad14125 into OpenMined:dev Feb 28, 2024
32 checks passed
@khoaguin khoaguin deleted the fix-mypy-issues-service-dir branch February 29, 2024 01:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants