From e241404796a6614327fbd2607370ea3bf9aa18d2 Mon Sep 17 00:00:00 2001 From: MohammadMahdi Khalaj Date: Wed, 1 Nov 2023 10:55:39 +0330 Subject: [PATCH] Create a separate copy of the base class --- aggify/aggify.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/aggify/aggify.py b/aggify/aggify.py index 338d2c6..11283c7 100644 --- a/aggify/aggify.py +++ b/aggify/aggify.py @@ -52,7 +52,10 @@ def __init__(self, base_model: Type[Document]): Args: base_model: The base model class. """ - self.base_model = base_model + # Create a separate copy of the main class for safety and flexibility + self.base_model = type( + "Aggify_base_model", base_model.__bases__, dict(base_model.__dict__) + ) self.pipelines: list[dict[str, dict | Any]] = [] self.start = None self.stop = None