From a58bd6ed4aa420c705b467c160d0bad3dca4b9f4 Mon Sep 17 00:00:00 2001 From: Automated Action Date: Mon, 19 May 2025 09:37:16 +0000 Subject: [PATCH] Fix Pydantic error by adding type annotation to DB_DIR and updating to Pydantic v2 configs --- app/core/config.py | 6 ++---- app/schemas/item.py | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/app/core/config.py b/app/core/config.py index bc0dfc0..470d409 100644 --- a/app/core/config.py +++ b/app/core/config.py @@ -24,13 +24,11 @@ class Settings(BaseSettings): raise ValueError(v) # Database configuration - DB_DIR = Path("/app") / "storage" / "db" + DB_DIR: Path = Path("/app") / "storage" / "db" DB_DIR.mkdir(parents=True, exist_ok=True) SQLALCHEMY_DATABASE_URL: str = f"sqlite:///{DB_DIR}/db.sqlite" - class Config: - case_sensitive = True - env_file = ".env" + model_config = {"case_sensitive": True, "env_file": ".env"} settings = Settings() diff --git a/app/schemas/item.py b/app/schemas/item.py index 27f37a0..dfb716d 100644 --- a/app/schemas/item.py +++ b/app/schemas/item.py @@ -27,8 +27,7 @@ class ItemInDBBase(ItemBase): created_at: datetime updated_at: datetime - class Config: - from_attributes = True + model_config = {"from_attributes": True} # Properties to return to client