From 82a5b9ef093a778dac9222b8e6e498b2d2c23f3b Mon Sep 17 00:00:00 2001 From: Aleksandra Ovchinnikova Date: Wed, 20 Dec 2023 11:15:06 -0800 Subject: [PATCH] Fix Message deserialize for empty task output runtime --- connect/eaas/core/proto.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/connect/eaas/core/proto.py b/connect/eaas/core/proto.py index de8c2f2..20b652e 100644 --- a/connect/eaas/core/proto.py +++ b/connect/eaas/core/proto.py @@ -305,6 +305,8 @@ def deserialize(cls, raw): raw_data = raw.get('data') if version == 2: + if 'output' in raw_data and 'runtime' in raw_data['output']: + raw['data']['output']['runtime'] = raw_data['output']['runtime'] or 0.0 return cls(**raw) if message_type == MessageType.CAPABILITIES: @@ -368,7 +370,7 @@ def deserialize(cls, raw): result=raw_data['result'], data=raw_data.get('data'), countdown=raw_data['countdown'], - runtime=raw_data.get('runtime'), + runtime=raw_data.get('runtime', 0.0), message=raw_data.get('output'), ), ),