Some refactoring
This commit is contained in:
parent
e8c7600ed7
commit
e43f81df39
|
@ -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"
|
|
@ -6,7 +6,7 @@ from typing_extensions import Self
|
|||
|
||||
from hellocomputer.db import StorageEngines
|
||||
|
||||
from .db import DDB
|
||||
from . import DDB
|
||||
|
||||
|
||||
class SessionDB(DDB):
|
|
@ -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):
|
|
@ -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
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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()
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
|
@ -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 = (
|
||||
|
|
|
@ -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"
|
||||
|
|
|
@ -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"
|
||||
|
|
Loading…
Reference in a new issue