From b682be8f63b5c3cd3d92bec0cd71069091e926bb Mon Sep 17 00:00:00 2001 From: yangxuan Date: Fri, 15 Sep 2023 16:46:15 +0800 Subject: [PATCH] Enable ignored checker PYI024 Signed-off-by: yangxuan --- pymilvus/client/interceptor.py | 15 +++++++++------ pyproject.toml | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/pymilvus/client/interceptor.py b/pymilvus/client/interceptor.py index 29a9fb24d..c941f7809 100644 --- a/pymilvus/client/interceptor.py +++ b/pymilvus/client/interceptor.py @@ -13,8 +13,7 @@ # limitations under the License. """Base class for interceptors that operate on all RPC types.""" -import collections -from typing import Any, Callable, List +from typing import Any, Callable, List, NamedTuple import grpc @@ -73,10 +72,14 @@ def intercept_stream_stream( return postprocess(response_it) if postprocess else response_it -class _ClientCallDetails( - collections.namedtuple("_ClientCallDetails", ("method", "timeout", "metadata", "credentials")), - grpc.ClientCallDetails, -): +class ClientCallDetailsTuple(NamedTuple): + method: Any + timeout: Any + metadata: Any + credentials: Any + + +class _ClientCallDetails(ClientCallDetailsTuple, grpc.ClientCallDetails): pass diff --git a/pyproject.toml b/pyproject.toml index efc5a662f..05ef1e7c0 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -92,7 +92,6 @@ ignore = [ "TRY400", "PLR0912", # TODO "C901", # TODO - "PYI024", # TODO "PYI041", # TODO ]