Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7bce39d

Browse files
committed
update error message
1 parent 7f9a7b9 commit 7bce39d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

google/api_core/protobuf_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ def from_any_pb(pb_type, any_pb):
6363
# Unpack the Any object and populate the protobuf message instance.
6464
if not any_pb.Unpack(msg_pb):
6565
raise TypeError(
66-
f"Could not convert Any[{any_pb.TypeName()}] to {msg_pb.DESCRIPTOR.full_name}"
66+
f"Could not convert `google.protobuf.any_pb2.Any` with underlying type `{any_pb.TypeName()}` to `{msg_pb.DESCRIPTOR.full_name}`"
6767
)
6868

6969
# Done; return the message.

tests/unit/test_protobuf_helpers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def test_from_any_pb_failure():
6969
with pytest.raises(
7070
TypeError,
7171
match=re.escape(
72-
"Could not convert Any[google.type.Date] to google.type.TimeOfDay"
72+
"Could not convert `google.protobuf.any_pb2.Any` with underlying type `google.type.Date` to `google.type.TimeOfDay`"
7373
),
7474
):
7575
protobuf_helpers.from_any_pb(timeofday_pb2.TimeOfDay, in_message)

0 commit comments

Comments
 (0)