From 71a5cedb46ec6b1d5f14d3dc5718111e46e366da Mon Sep 17 00:00:00 2001 From: Robert Bradshaw Date: Tue, 17 Dec 2024 17:06:26 -0800 Subject: [PATCH] Deserialization fix. --- sdks/python/apache_beam/metrics/cells.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sdks/python/apache_beam/metrics/cells.py b/sdks/python/apache_beam/metrics/cells.py index 92f5c7cbe2f6..8f3d7bba22ad 100644 --- a/sdks/python/apache_beam/metrics/cells.py +++ b/sdks/python/apache_beam/metrics/cells.py @@ -822,7 +822,9 @@ def from_proto(proto: metrics_pb2.BoundedTrie) -> 'BoundedTrieData': return BoundedTrieData( bound=proto.bound, singleton=tuple(proto.singleton) if proto.singleton else None, - root=_BoundedTrieNode.from_proto(proto.root) if proto.root else None) + root=( + _BoundedTrieNode.from_proto(proto.root) + if proto.HasField('root') else None)) def as_trie(self): if self._root is not None: