[Bug]: [typing] "_models" in typing annotation confuses sphinx #6152
Labels
bug
Something isn't working
emitter:client:python
Issue for the Python client emitter: @typespec/http-client-python
Describe the bug
This is transferred from Azure/autorest.python#2964
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.
Reproduction
As above
Checklist
The text was updated successfully, but these errors were encountered: