From 23f94ffbc4cf05cf082862610f03e2a7c27fd3f5 Mon Sep 17 00:00:00 2001 From: Avasam Date: Mon, 28 Apr 2025 02:43:46 -0400 Subject: [PATCH] Remove Any in `stubs/grpcio/grpc_status/rpc_status.pyi` (#13895) --- pyrightconfig.stricter.json | 1 + stubs/grpcio/@tests/test_cases/check_status.py | 8 -------- stubs/grpcio/grpc_status/rpc_status.pyi | 10 ++-------- 3 files changed, 3 insertions(+), 16 deletions(-) delete mode 100644 stubs/grpcio/@tests/test_cases/check_status.py diff --git a/pyrightconfig.stricter.json b/pyrightconfig.stricter.json index 776f3d7df..1cba7f451 100644 --- a/pyrightconfig.stricter.json +++ b/pyrightconfig.stricter.json @@ -45,6 +45,7 @@ "stubs/geopandas", "stubs/google-cloud-ndb", "stubs/grpcio/grpc/__init__.pyi", + "stubs/grpcio/grpc_status/rpc_status.pyi", "stubs/hdbcli/hdbcli/dbapi.pyi", "stubs/html5lib", "stubs/httplib2", diff --git a/stubs/grpcio/@tests/test_cases/check_status.py b/stubs/grpcio/@tests/test_cases/check_status.py deleted file mode 100644 index b9e1776b6..000000000 --- a/stubs/grpcio/@tests/test_cases/check_status.py +++ /dev/null @@ -1,8 +0,0 @@ -from __future__ import annotations - -from grpc import Status -from grpc_status import to_status - -# XXX: to_status actually expects a "google.rpc.status.Status", -# but the stubs for that aren't present yet. -status: Status = to_status(None) diff --git a/stubs/grpcio/grpc_status/rpc_status.pyi b/stubs/grpcio/grpc_status/rpc_status.pyi index abf6b8761..090716d5c 100644 --- a/stubs/grpcio/grpc_status/rpc_status.pyi +++ b/stubs/grpcio/grpc_status/rpc_status.pyi @@ -1,13 +1,7 @@ -from typing import Any - import grpc -# XXX: don't yet know how to add a stub for google.rpc.status_pb2.Status -# without affecting other stuff; may need to make a stub-only package for -# google.rpc as well. - # Returns a google.rpc.status.Status message corresponding to a given grpc.Call. -def from_call(call: grpc.Call) -> Any: ... +def from_call(call: grpc.Call): ... # Convert a google.rpc.status.Status message to grpc.Status. -def to_status(status: Any) -> grpc.Status: ... +def to_status(status) -> grpc.Status: ...