Skip to content

Fix Pyright errors in utils/types.py #30196

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

XueSongTap
Copy link

fix #30147

@XueSongTap XueSongTap requested a review from a team as a code owner April 17, 2025 16:16
@github-actions github-actions bot added the category: Python API OpenVINO Python bindings label Apr 17, 2025
@sys-openvino-ci sys-openvino-ci added the ExternalPR External contributor label Apr 17, 2025
return input_value
return make_constant_node(input_value, name=name)


def as_nodes(*input_values: NodeInput, name: Optional[str] = None) -> List[Node]:
def as_nodes(*input_values: NodeInput, name: Optional[str] = None) -> List[Union[Node, Output]]:
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
def as_nodes(*input_values: NodeInput, name: Optional[str] = None) -> List[Union[Node, Output]]:
def as_nodes(*input_values: NodeInput, name: Optional[str] = None) -> List[Union[Node, Output, Constant]]:

because as_node returns Union[Node, Output, Constant] several lines above

@mlukasze
Copy link
Contributor

linters check failed, fix it, please

@p-wysocki
Copy link
Contributor

Thank you for the PR, the fix looks great! Could you please also regenerate .pyi files as mentioned in the issue description? All you need to do is build OpenVINO with -DENABLE_WHEEL=ON, install that wheel python -m pip install build/wheels/openvino... and either:

  • make any commit, and the .pyi files will be automatically regenerated and added to your commit
  • run python src/bindings/python/scripts/generate_stub_files.py and git add them manually

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Python API OpenVINO Python bindings ExternalPR External contributor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Good First Issue]: Fix pyright in: src/openvino/utils/types.py
5 participants