From 34e843f7f36814636dd8dbc7558341924bd6d954 Mon Sep 17 00:00:00 2001 From: Mike Salvatore Date: Tue, 13 Sep 2022 07:50:38 -0400 Subject: [PATCH] Common: Make PydanticEventSerializer generic --- monkey/common/event_serializers/pydantic_event_serializer.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/monkey/common/event_serializers/pydantic_event_serializer.py b/monkey/common/event_serializers/pydantic_event_serializer.py index fab4f8c06..87ac201f8 100644 --- a/monkey/common/event_serializers/pydantic_event_serializer.py +++ b/monkey/common/event_serializers/pydantic_event_serializer.py @@ -1,5 +1,5 @@ import logging -from typing import Type, TypeVar +from typing import Generic, Type, TypeVar from common.events import AbstractAgentEvent @@ -10,7 +10,7 @@ logger = logging.getLogger(__name__) T = TypeVar("T", bound=AbstractAgentEvent) -class PydanticEventSerializer(IEventSerializer): +class PydanticEventSerializer(IEventSerializer, Generic[T]): def __init__(self, event_class: Type[T]): self._event_class = event_class