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 f39b62c38..beb02e9fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -93,7 +93,6 @@ ignore = [ "PLR0912", # TODO "C901", # TODO "PYI041", # TODO - "PYI024", # TODO ] # Allow autofix for all enabled rules (when `--fix`) is provided.