Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dapr/clients/grpc/_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@
"""

from enum import Enum
from typing import Any, Dict, List, Optional, Tuple, Union
from typing import Any, Dict, List, Optional, Tuple, Union, cast

from google.protobuf import json_format
from google.protobuf.any_pb2 import Any as GrpcAny
from google.protobuf.descriptor import Descriptor
from google.protobuf.message import Message as GrpcMessage
from google.protobuf.struct_pb2 import Struct
from google.protobuf.wrappers_pb2 import (
Expand Down Expand Up @@ -63,7 +64,7 @@ def unpack(data: GrpcAny, message: GrpcMessage) -> None:
"""
if not isinstance(message, GrpcMessage):
raise ValueError('output message is not protocol buffer message object')
if not data.Is(message.DESCRIPTOR):
if not data.Is(cast(Descriptor, message.DESCRIPTOR)):
raise ValueError(f'invalid type. serialized message type: {data.type_url}')
data.Unpack(message)

Expand Down
Loading