-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Fix pyright issue #30147 #30192
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
Fix pyright issue #30147 #30192
Conversation
linter failed, please fix |
|
||
|
||
def as_nodes(*input_values: NodeInput, name: Optional[str] = None) -> List[Node]: | ||
"""Return input values as nodes. Scalars will be converted to Constant nodes.""" | ||
return [as_node(input_value, name=name) for input_value in input_values] | ||
return cast(List[Node], [as_node(input_value, name=name) for input_value in input_values]) |
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.
Fix for failing flake8 check
return cast(List[Node], [as_node(input_value, name=name) for input_value in input_values]) | |
return cast(List[Node], [as_node(input_value, name=name) for input_value in input_values]) | |
Thank you for the investigation! The tasks for fixing |
Description
This PR fixes issue #30147 by resolving the Pyright errors in the
src/openvino/utils/types.py
file.Changes made
cast
import from the typing libraryas_node
function to use proper type casting withisinstance
checks instead ofissubclass(type())
as_nodes
function usingcast
for proper list typingTesting
src/openvino/utils/types.py
from the exclusions inpyproject.toml