Skip to content
This repository was archived by the owner on Apr 1, 2026. It is now read-only.

Commit d785b8b

Browse files
committed
Modify docstring to indicate message.DecodeError when proto parsing failed
1 parent 13236e6 commit d785b8b

3 files changed

Lines changed: 11 additions & 6 deletions

File tree

google/cloud/bigtable/data/_async/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,7 @@ async def execute_query(
728728
}
729729
730730
If ``column_info`` is not provided, or if a specific column name is not found
731-
in the dictionary, or if deserialization fails:
731+
in the dictionary:
732732
733733
- PROTO columns will be returned as raw bytes.
734734
- ENUM columns will be returned as integers.
@@ -773,6 +773,7 @@ async def execute_query(
773773
google.api_core.exceptions.GoogleAPIError: raised if the request encounters an unrecoverable error
774774
google.cloud.bigtable.data.exceptions.ParameterTypeInferenceFailed: Raised if
775775
a parameter is passed without an explicit type, and the type cannot be infered
776+
google.protobuf.message.DecodeError: raised if the deserialization of a PROTO/ENUM value fails.
776777
"""
777778
instance_name = self._gapic_client.instance_path(self.project, instance_id)
778779
converted_param_types = _to_param_types(parameters, parameter_types)

google/cloud/bigtable/data/_sync_autogen/client.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ def execute_query(
555555
}
556556
557557
If ``column_info`` is not provided, or if a specific column name is not found
558-
in the dictionary, or if deserialization fails:
558+
in the dictionary:
559559
560560
- PROTO columns will be returned as raw bytes.
561561
- ENUM columns will be returned as integers.
@@ -600,6 +600,7 @@ def execute_query(
600600
google.api_core.exceptions.GoogleAPIError: raised if the request encounters an unrecoverable error
601601
google.cloud.bigtable.data.exceptions.ParameterTypeInferenceFailed: Raised if
602602
a parameter is passed without an explicit type, and the type cannot be infered
603+
google.protobuf.message.DecodeError: raised if the deserialization of a PROTO/ENUM value fails.
603604
"""
604605
instance_name = self._gapic_client.instance_path(self.project, instance_id)
605606
converted_param_types = _to_param_types(parameters, parameter_types)

google/cloud/bigtable/data/execute_query/_query_result_parsing_utils.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,10 +165,13 @@ def _parse_proto_type(
165165
166166
Returns:
167167
A deserialized Protobuf Message object if parsing is successful.
168-
If parsing fails for any reason, or if the required type information
169-
is not found in column_info, the function returns the original
170-
serialized data as bytes (value.bytes_value). This fallback
171-
ensures that the raw data is still accessible.
168+
If the required type information is not found in column_info, the function
169+
returns the original serialized data as bytes (value.bytes_value).
170+
This fallback ensures that the raw data is still accessible.
171+
172+
Raises:
173+
google.protobuf.message.DecodeError: If `value.bytes_value` cannot be
174+
parsed as the Message type specified in `column_info`.
172175
"""
173176
if (
174177
column_name is not None

0 commit comments

Comments
 (0)