Automated change: Fix sanity tests
diff --git a/src/python/grpcio/grpc/aio/_base_server.py b/src/python/grpcio/grpc/aio/_base_server.py index 3559568..1ed3f60 100644 --- a/src/python/grpcio/grpc/aio/_base_server.py +++ b/src/python/grpcio/grpc/aio/_base_server.py
@@ -18,7 +18,9 @@ import grpc -from ._metadata import Metadata # pyright: ignore[reportUnusedImport] # pylint: disable=unused-import +from ._metadata import ( + Metadata, # pyright: ignore[reportUnusedImport] # pylint: disable=unused-import +) from ._typing import DoneCallbackType from ._typing import MetadataType from ._typing import RequestType @@ -137,7 +139,9 @@ """ def add_registered_method_handlers( # noqa: B027 - self, service_name: str, method_handlers: Mapping[str, grpc.RpcMethodHandler] + self, + service_name: str, + method_handlers: Mapping[str, grpc.RpcMethodHandler], ): """Registers GenericRpcHandlers with this Server.
diff --git a/src/python/grpcio/grpc/aio/_call.py b/src/python/grpcio/grpc/aio/_call.py index 3a969e1..649a31b 100644 --- a/src/python/grpcio/grpc/aio/_call.py +++ b/src/python/grpcio/grpc/aio/_call.py
@@ -37,7 +37,7 @@ from ._metadata import Metadata from ._typing import DeserializingFunction from ._typing import DoneCallbackType -from ._typing import EOFType # pyright: ignore[reportUnknownVariableType] +from ._typing import EOFType # pyright: ignore[reportUnknownVariableType] from ._typing import MetadataType from ._typing import MetadatumType from ._typing import RequestIterableType @@ -182,8 +182,12 @@ ) -> AioRpcError: return AioRpcError( _common.CYGRPC_STATUS_CODE_TO_STATUS_CODE[status.code()], - Metadata._create(initial_metadata), # pyright: ignore[reportPrivateUsage] - Metadata.from_tuple(status.trailing_metadata()), # pyright: ignore[reportUnknownMemberType] + Metadata._create( + initial_metadata + ), # pyright: ignore[reportPrivateUsage] + Metadata.from_tuple( + status.trailing_metadata() + ), # pyright: ignore[reportUnknownMemberType] details=status.details(), debug_error_string=status.debug_error_string(), ) @@ -246,7 +250,9 @@ async def initial_metadata(self) -> Metadata: raw_metadata_tuple = await self._cython_call.initial_metadata() - return Metadata.from_tuple(raw_metadata_tuple) # pyright: ignore[reportUnknownMemberType] + return Metadata.from_tuple( + raw_metadata_tuple + ) # pyright: ignore[reportUnknownMemberType] async def trailing_metadata(self) -> Metadata: raw_metadata_tuple = ( @@ -254,7 +260,9 @@ ).trailing_metadata() if not raw_metadata_tuple: return Metadata() - return Metadata.from_tuple(raw_metadata_tuple) # pyright: ignore[reportUnknownMemberType] + return Metadata.from_tuple( + raw_metadata_tuple + ) # pyright: ignore[reportUnknownMemberType] async def code(self) -> grpc.StatusCode: cygrpc_code = (await self._cython_call.status()).code() @@ -295,7 +303,9 @@ class _UnaryResponseMixin(Call, Generic[ResponseType]): _call_response: asyncio.Task[ResponseType] - def _init_unary_response_mixin(self, response_task: asyncio.Task[ResponseType]): + def _init_unary_response_mixin( + self, response_task: asyncio.Task[ResponseType] + ): self._call_response = response_task def cancel(self) -> bool:
diff --git a/src/python/grpcio/grpc/aio/_metadata.py b/src/python/grpcio/grpc/aio/_metadata.py index 8a885d7..4be094a 100644 --- a/src/python/grpcio/grpc/aio/_metadata.py +++ b/src/python/grpcio/grpc/aio/_metadata.py
@@ -46,6 +46,7 @@ * Supports an immutable view of the data * Allows partial mutation on the data without recreating the new object from scratch. """ + _metadata: OrderedDict[MetadataKey, List[MetadataValue]] def __init__(self, *args: MetadatumType) -> None: