-
Notifications
You must be signed in to change notification settings - Fork 328
Labels
emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonIssue for the Python client emitter: @typespec/http-client-python
Description
I used the latest Python TypeSpec emitter on this tsplocation:
directory: specification/purview/data-plane/datamap
commit: 0c932f4a1e126784161397209484678f3adda2f6
repo: Azure/azure-rest-api-specs
additionalDirectories:
I get annotation using list, so the code is not valid:
azure/purview/datamap/__init__.py:15: in <module>
from ._client import DataMapClient # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure/purview/datamap/_client.py:19: in <module>
from .operations import (
azure/purview/datamap/operations/__init__.py:15: in <module>
from ._operations import EntityOperations # type: ignore
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
azure/purview/datamap/operations/_operations.py:30: in <module>
from .. import models as _models
azure/purview/datamap/models/__init__.py:16: in <module>
from ._models import ( # type: ignore
azure/purview/datamap/models/_models.py:496: in <module>
class AtlasClassifications(_Model):
azure/purview/datamap/models/_models.py:514: in AtlasClassifications
list: Optional[list[Any]] = rest_field(visibility=["read", "create", "update", "delete", "query"])
^^^^^^^^^
E TypeError: '_RestField' object is not subscriptable
Either we import "from future import annotation", or we use List. I think I prefer to import future annotations, since it's more oriented to the future.
I'm using Python 3.12.3, so totally recent runtime.
Copilot
Metadata
Metadata
Labels
emitter:client:pythonIssue for the Python client emitter: @typespec/http-client-pythonIssue for the Python client emitter: @typespec/http-client-python