File tree Expand file tree Collapse file tree 1 file changed +6
-0
lines changed
sdks/python/apache_beam/coders Expand file tree Collapse file tree 1 file changed +6
-0
lines changed Original file line number Diff line number Diff line change @@ -316,6 +316,9 @@ def decode(self, encoded):
316316 proto_message .ParseFromString (encoded ) # This is in effect "ParsePartial".
317317 return proto_message
318318
319+ def estimate_size (self , value , nested = False ):
320+ return self ._get_nested_size (value .ByteSize (), nested )
321+
319322
320323class DeterministicProtoCoderImpl (ProtoCoderImpl ):
321324 """For internal use only; no backwards-compatibility guarantees."""
@@ -335,6 +338,9 @@ def encode(self, value):
335338 def decode (self , value ):
336339 return self .proto_plus_type .deserialize (value )
337340
341+ def estimate_size (self , value , nested = False ):
342+ return self ._get_nested_size (type (value ).pb (value ).ByteSize (), nested )
343+
338344
339345UNKNOWN_TYPE = 0xFF
340346NONE_TYPE = 0
You can’t perform that action at this time.
0 commit comments