From 38a29f97b123d5498b383d16f124a680aa3e3759 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Jos=C3=A9=20Camacho?= Date: Fri, 10 Nov 2023 14:33:39 -0600 Subject: [PATCH] [DH-4984] Store sql_query_result for the GET endpoints (#243) --- dataherald/repositories/base.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dataherald/repositories/base.py b/dataherald/repositories/base.py index 511bafd2..5d589d19 100644 --- a/dataherald/repositories/base.py +++ b/dataherald/repositories/base.py @@ -11,7 +11,7 @@ def __init__(self, storage): self.storage = storage def insert(self, response: Response) -> Response: - response_dict = response.dict(exclude={"id", "sql_query_result"}) + response_dict = response.dict(exclude={"id"}) response_dict["question_id"] = ObjectId(response.question_id) response.id = str(self.storage.insert_one(DB_COLLECTION, response_dict)) return response @@ -25,7 +25,7 @@ def find_one(self, query: dict) -> Response | None: return Response(**row) def update(self, response: Response) -> Response: - response_dict = response.dict(exclude={"id", "sql_query_result"}) + response_dict = response.dict(exclude={"id"}) response_dict["question_id"] = ObjectId(response.question_id) self.storage.update_or_create(