From 8fe6d4914b0181f01f177afe34291d1cd1f96cd8 Mon Sep 17 00:00:00 2001 From: Moishe Lettvin Date: Mon, 25 Mar 2024 10:24:48 -0400 Subject: [PATCH] fix linter error --- src/dailyai/serializers/protobuf_serializer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/dailyai/serializers/protobuf_serializer.py b/src/dailyai/serializers/protobuf_serializer.py index 8c00c9c94..1aef2e6c2 100644 --- a/src/dailyai/serializers/protobuf_serializer.py +++ b/src/dailyai/serializers/protobuf_serializer.py @@ -17,14 +17,15 @@ class ProtobufFrameSerializer(FrameSerializer): def __init__(self): pass - def serialize(self, frame: TextFrame | AudioFrame | TranscriptionQueueFrame) -> bytes: + def serialize(self, frame: Frame) -> bytes: proto_frame = frame_protos.Frame() if type(frame) not in self.SERIALIZABLE_TYPES: raise ValueError( f"Frame type {type(frame)} is not serializable. You may need to add it to ProtobufFrameSerializer.SERIALIZABLE_FIELDS.") + # type: ignore (unnecessary warnings, we check type above) proto_optional_name = self.SERIALIZABLE_TYPES[type(frame)] - for field in dataclasses.fields(frame): + for field in dataclasses.fields(frame): # type: ignore setattr(getattr(proto_frame, proto_optional_name), field.name, getattr(frame, field.name))