-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix #30149: Fix Pyright errors in utils/decorators.py #30194
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
base: master
Are you sure you want to change the base?
Conversation
|
||
from openvino import Node, Output | ||
from openvino.utils.types import NodeInput, as_node, as_nodes | ||
|
||
|
||
def _get_name(**kwargs: Any) -> Node: | ||
def _get_name(**kwargs: Any) -> Optional[str]: # Corretto il tipo di ritorno |
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.
if needed, comments should be in english, please :)
elif get_origin(type_arg) == list: | ||
if issubclass(actual_type, list): | ||
if isinstance(actual_type, type) and issubclass(actual_type, list): | ||
return True |
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.
it could be one-line condition, elif itself makes no sense here, imho, nesting for sure
@akuporos what's your opinion?
return True | ||
return False | ||
|
||
def matches_optional(self, optional_type, actual_type) -> bool: # type: ignore | ||
def matches_optional(self, optional_type: Any, actual_type: Any) -> bool: |
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.
unnecessary change
Thank you for the PR! Could you please also regenerate
|
requested changes done, removing roadblock, enabling CI
Description
This PR fixes issue #30149 by resolving the Pyright errors in the
src/openvino/utils/decorators.py
file.Changes made
_get_name
function fromNode
toOptional[str]
MultiMethod
classissubclass
calls to prevent type errorsTesting
src/openvino/utils/decorators.py
from the exclusions inpyproject.toml