From f1a664e5a72a70c048b250a601931fcce87b036c Mon Sep 17 00:00:00 2001 From: Bryan Van Deusen Date: Tue, 9 Jun 2026 23:50:59 -0400 Subject: [PATCH] fix(services): PEP 695 type params for get_or_create (ruff UP047) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CI lint flagged UP047 — use the native generic syntax def get_or_create[T](...) instead of typing.TypeVar on Python 3.14. Co-Authored-By: Claude Opus 4.8 (1M context) --- backend/app/services/db_helpers.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/backend/app/services/db_helpers.py b/backend/app/services/db_helpers.py index 2b934c4..992a76d 100644 --- a/backend/app/services/db_helpers.py +++ b/backend/app/services/db_helpers.py @@ -15,16 +15,13 @@ sync/async boundary; the importer one stays as the lone sync consumer. from __future__ import annotations from collections.abc import Awaitable, Callable -from typing import TypeVar from sqlalchemy import Select from sqlalchemy.exc import IntegrityError from sqlalchemy.ext.asyncio import AsyncSession -T = TypeVar("T") - -async def get_or_create( +async def get_or_create[T]( session: AsyncSession, select_stmt: Select, factory: Callable[[], Awaitable[T]],