Some refactoring

This commit is contained in:
Guillem Borrell 2024-06-16 09:31:33 +02:00
parent e8c7600ed7
commit e43f81df39
10 changed files with 13 additions and 13 deletions

View file

@ -1,7 +1,8 @@
from enum import StrEnum
from sqlalchemy import create_engine, text
from pathlib import Path
from sqlalchemy import create_engine, text
class StorageEngines(StrEnum):
local = "Local"

View file

@ -6,7 +6,7 @@ from typing_extensions import Self
from hellocomputer.db import StorageEngines
from .db import DDB
from . import DDB
class SessionDB(DDB):

View file

@ -8,7 +8,7 @@ from uuid import UUID, uuid4
import duckdb
import polars as pl
from .db import DDB, StorageEngines
from . import DDB, StorageEngines
class UserDB(DDB):

View file

@ -1,10 +1,9 @@
from fastapi import APIRouter
from fastapi.responses import PlainTextResponse
from hellocomputer.db import StorageEngines
from hellocomputer.db.sessions import SessionDB
from hellocomputer.extraction import extract_code_block
from hellocomputer.sessions import SessionDB
from ..config import settings
from ..models import Chat

View file

@ -5,7 +5,7 @@ from starlette.requests import Request
from hellocomputer.config import settings
from hellocomputer.db import StorageEngines
from hellocomputer.users import UserDB
from hellocomputer.db.users import UserDB
router = APIRouter()

View file

@ -7,8 +7,8 @@ from starlette.requests import Request
from ..config import settings
from ..db import StorageEngines
from ..sessions import SessionDB
from ..users import OwnershipDB
from ..db.sessions import SessionDB
from ..db.users import OwnershipDB
router = APIRouter()

View file

@ -1,12 +1,12 @@
from typing import List
from uuid import uuid4
from fastapi import APIRouter
from fastapi.responses import PlainTextResponse
from starlette.requests import Request
from typing import List
from hellocomputer.db import StorageEngines
from hellocomputer.users import OwnershipDB
from hellocomputer.db.users import OwnershipDB
from ..config import settings

View file

@ -2,7 +2,7 @@ from pathlib import Path
import hellocomputer
from hellocomputer.db import StorageEngines
from hellocomputer.sessions import SessionDB
from hellocomputer.db.sessions import SessionDB
TEST_STORAGE = StorageEngines.local
TEST_XLS_PATH = (

View file

@ -6,7 +6,7 @@ from hellocomputer.config import settings
from hellocomputer.db import StorageEngines
from hellocomputer.extraction import extract_code_block
from hellocomputer.models import Chat
from hellocomputer.sessions import SessionDB
from hellocomputer.db.sessions import SessionDB
TEST_STORAGE = StorageEngines.local
TEST_OUTPUT_FOLDER = Path(hellocomputer.__file__).parents[2] / "test" / "output"

View file

@ -2,7 +2,7 @@ from pathlib import Path
import hellocomputer
from hellocomputer.db import StorageEngines
from hellocomputer.users import OwnershipDB, UserDB
from hellocomputer.db.users import OwnershipDB, UserDB
TEST_STORAGE = StorageEngines.local
TEST_OUTPUT_FOLDER = Path(hellocomputer.__file__).parents[2] / "test" / "output"