From 8e8f416246f149a8622ca1c415c8aca0e5ec8e1f Mon Sep 17 00:00:00 2001 From: Travis Abendshien <46939827+CyanVoxel@users.noreply.github.com> Date: Thu, 28 Aug 2025 00:24:47 -0700 Subject: [PATCH] refactor: fix type hints in db.py --- src/tagstudio/core/library/alchemy/db.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tagstudio/core/library/alchemy/db.py b/src/tagstudio/core/library/alchemy/db.py index 78a766f1..026678dd 100644 --- a/src/tagstudio/core/library/alchemy/db.py +++ b/src/tagstudio/core/library/alchemy/db.py @@ -4,6 +4,7 @@ from pathlib import Path +from typing import override import structlog from sqlalchemy import Dialect, Engine, String, TypeDecorator, create_engine, text @@ -19,12 +20,14 @@ class PathType(TypeDecorator): impl = String cache_ok = True - def process_bind_param(self, value: Path, dialect: Dialect): + @override + def process_bind_param(self, value: Path | None, dialect: Dialect): if value is not None: return Path(value).as_posix() return None - def process_result_value(self, value: str, dialect: Dialect): + @override + def process_result_value(self, value: str | None, dialect: Dialect): if value is not None: return Path(value) return None