File tree Expand file tree Collapse file tree 2 files changed +6
-0
lines changed
Expand file tree Collapse file tree 2 files changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -507,6 +507,10 @@ def calculate(
507507 needed_fields = _get_needed_fields (destinations )
508508 backing_str_tensor = None
509509 if options .use_string_view :
510+ assert self ._message_format == "binary" , (
511+ "`options.use_string_view` is only compatible with 'binary' message "
512+ "format. Please create the root expression with "
513+ "message_format='binary'." )
510514 backing_str_tensor = self ._tensor_of_protos
511515 fields = parse_message_level_ex .parse_message_level_ex (
512516 self ._tensor_of_protos ,
Original file line number Diff line number Diff line change @@ -160,6 +160,8 @@ def parse_message_level(
160160 # TODO(b/172576749): Once we allow sufficient bake in time for the kernel
161161 # change, switch to using V3 only.
162162 if backing_str_tensor :
163+ assert message_format == "binary" , (
164+ "message_format must be 'binary' if a backing_str_tensor is provided" )
163165 values , indices = gen_decode_proto_sparse .decode_proto_sparse_v3 (
164166 tensor_of_protos ,
165167 backing_str_tensor ,
You can’t perform that action at this time.
0 commit comments