From 6a2ca5e719b35e807a366cac5d0996e041737e5c Mon Sep 17 00:00:00 2001 From: WorldTeacher Date: Wed, 27 Nov 2024 14:48:47 +0100 Subject: [PATCH] chore: revert to use base settings class instead of partial settings --- src/backend/database.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/backend/database.py b/src/backend/database.py index 403b1a1..b5873ce 100644 --- a/src/backend/database.py +++ b/src/backend/database.py @@ -3,7 +3,7 @@ import inspect import sqlite3 as sql import tempfile from pathlib import Path -from src import database +from src import settings from typing import Any, Dict, List, Optional, Tuple, Union # from icecream import ic from omegaconf import OmegaConf @@ -33,7 +33,7 @@ from icecream import ic ascii_lowercase = "abcdefghijklmnopqrstuvwxyz0123456789)" caller_frame = inspect.stack()[1] # get the line that called the function - +database = settings.database class Database: """ Initialize the database and create the tables if they do not exist. @@ -302,7 +302,7 @@ class Database: result = self.query_db( "SELECT bookdata FROM media WHERE app_id=? AND prof_id=?", (app_id, prof_id) ) - books = [load_pickle(i[0]) for i in result] + books: list[BookData] = [load_pickle(i[0]) for i in result] book = [i for i in books if i.signature == signature][0] return book