Skip to content

Commit 7ecabf5

Browse files
authored
Bring back Schema Registry to type complete (#36945)
* Bring back Schema Registry to type complete * Explicit typing extensions dep
1 parent 7c06207 commit 7ecabf5

File tree

4 files changed

+7
-6
lines changed

4 files changed

+7
-6
lines changed

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_patch.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def __init__(self, **kwargs: Any) -> None:
390390
self.name: str = kwargs.pop("name")
391391
self.version: int = kwargs.pop("version")
392392

393-
def __repr__(self):
393+
def __repr__(self) -> str:
394394
return (
395395
f"SchemaProperties(id={self.id}, format={self.format}, "
396396
f"group_name={self.group_name}, name={self.name}, version={self.version})"[:1024]
@@ -411,7 +411,7 @@ def __init__(self, **kwargs: Any) -> None:
411411
self.definition: str = kwargs.pop("definition")
412412
self.properties: SchemaProperties = kwargs.pop("properties")
413413

414-
def __repr__(self):
414+
def __repr__(self) -> str:
415415
return f"Schema(definition={self.definition}, properties={self.properties})"[:1024]
416416

417417

sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/aio/_patch.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Dict,
1919
)
2020
from functools import partial
21+
from typing_extensions import Self
2122

2223
from azure.core.tracing.decorator_async import distributed_trace_async
2324

@@ -42,7 +43,7 @@
4243
###### Wrapper Class ######
4344

4445

45-
class SchemaRegistryClient(object):
46+
class SchemaRegistryClient:
4647
"""
4748
SchemaRegistryClient is a client for registering and retrieving schemas from the Azure Schema Registry service.
4849
@@ -78,11 +79,11 @@ def __init__(
7879
**kwargs,
7980
)
8081

81-
async def __aenter__(self):
82+
async def __aenter__(self) -> Self:
8283
await self._generated_client.__aenter__()
8384
return self
8485

85-
async def __aexit__(self, *args):
86+
async def __aexit__(self, *args: Any) -> None:
8687
await self._generated_client.__aexit__(*args)
8788

8889
async def close(self) -> None:

sdk/schemaregistry/azure-schemaregistry/pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,3 @@
22
mypy = true
33
pyright = false
44
type_check_samples = true
5-
verifytypes = false

sdk/schemaregistry/azure-schemaregistry/setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
install_requires=[
7171
"azure-core<2.0.0,>=1.28.0",
7272
"isodate>=0.6.0",
73+
"typing-extensions>=4.6.0"
7374
],
7475
extras_require={
7576
"jsonencoder": [

0 commit comments

Comments
 (0)