-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
added isinstance checks to fix tox pyright errors #39780
Conversation
API change check API changes are not detected in this pull request. |
Finally green all checks passed 💯 |
@@ -323,15 +323,27 @@ def _get_type_alias_type(module_name: str, alias_name: str): | |||
return types[alias_name] | |||
|
|||
|
|||
def _get_model(module_name: str, model_name: str): | |||
def _get_model(module_name: str, model_name: typing.Union[str, typing.ForwardRef]) -> typing.Any: |
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.
Given these typing errors arise from the generated code, it is up to the code generator to fix them. We test our code generator against the latest versions of the type checkers we run, so it should generate type clean code for each client library. It looks like this library was last generated ~7 months ago. I suspect if we regenerate the code with the latest version of the generator that these errors will be cleaned up.
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.
Thanks @kristapratico for your comment. It prompted me to review the documentation again. I found it odd that I needed to modify these files, as the comments didn't indicate they were auto-generated.
I now understand that these files need to be rebuilt locally using the tsp-client and the latest azure-rest-api-specs for our project. As you mentioned, this hasn't been done in the last ~7 months, and I just picked this up. Apologies for the confusion.
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.
Ok seems I am stepping on toes here and a PR is already in review:
#38437
Dropping this PR request.
Sorry for the bother.
Closing duplicate effort. |
Description
I fixed some pyright errors that where showing up in builds.
Build error ref: https://dev.azure.com/azure-sdk/internal/_build/results?buildId=4534605&view=logs&j=b70e5e73-bbb6-5567-0939-8415943fadb9&t=56d4e2e6-c43b-527c-bad7-234ebe7429dd&l=86
The changes where made to the following files, but I am not sure if these are generated or not.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines