Skip to content

Commit

Permalink
[DH-4984] Store sql_query_result for the GET endpoints (#243)
Browse files Browse the repository at this point in the history
  • Loading branch information
jcjc712 authored Nov 10, 2023
1 parent 6b019cb commit 38a29f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dataherald/repositories/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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(
Expand Down

0 comments on commit 38a29f9

Please sign in to comment.