From bac31951d5c5a9dacb6632e535e3c4d284726390 Mon Sep 17 00:00:00 2001 From: XuanYang-cn Date: Mon, 18 Sep 2023 11:01:21 +0800 Subject: [PATCH] Enable ignored checker PYI024 (#1703) 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 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.