-
-
Notifications
You must be signed in to change notification settings - Fork 2k
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
[Refactor] Fixing mypy issues for syft/service/
and syft/util/
#8492
Conversation
then call the methods instead of using `assert` since assert statements are removed when compiling Python code to optimized bytecode, causing security issue
syft/service/
dirsyft/service/
and syft/util/
packages/syft/tests/syft/request/request_multiple_nodes_test.py
Outdated
Show resolved
Hide resolved
- comment out "--warn-unused-ignores" in precommit mypy - small mypy fixes in `service/action` Co-authored-by: Kien Dang <[email protected]>
`base_queue.py` and `queue.py`
Make _func_or_class positional-only in instrument Make noop accept additional arbitrary args and kwargs
947b2a4
to
beab7ca
Compare
handle cases when context is AuthedServiceContext where node is sure to present Co-authored-by: Shubham Gupta <[email protected]>
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 |
There was a problem hiding this comment.
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.
…data_cache is None
@@ -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] |
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed by: dd52fb2
to Shubham's recommendations Co-authored-by: Shubham Gupta <[email protected]>
pass type checking instead of returning `SyftError` or raise exceptions
fix typing of object in job stash
- extract input and output init kwargs via getattr instead in syft_function decorator
There was a problem hiding this 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 !! 🦾 💯
Fix mypy issues for
syft/service
andsyft/util
directories