Skip to content
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

[typing] "_models" in typing annotation confuses sphinx #2964

Open
xiangyan99 opened this issue Dec 11, 2024 · 0 comments
Open

[typing] "_models" in typing annotation confuses sphinx #2964

xiangyan99 opened this issue Dec 11, 2024 · 0 comments

Comments

@xiangyan99
Copy link
Member

we add "_models." in our generated code.

e.g.

def init(
self,
*,
vectorizer_name: str,
ai_services_vision_parameters: Optional["_models.AIServicesVisionParameters"] = None,
**kwargs: Any
) -> None:

The reason is to avoid name conflicts. we've had issues in the past, for example, if an enum is named the same thing as a model, by tying it to _models (we also make it private so we're not exposing anything), we avoid naming conflicts.

Unfortunately, Sphinx cannot parse the model "_models.AIServicesVisionParameters" correctly.

In Sphinx generated code, it shows
_models.SearchIndexerDataIdentity
and loses xref.

We need to find some other ways to solve the name conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant