From 128fde3ad619bb47d91f271c9cfa84bec75da409 Mon Sep 17 00:00:00 2001 From: joungmin Date: Sat, 28 Feb 2026 09:59:40 +0900 Subject: [PATCH] fix: Python 3.9 compatibility for union type hints Use Optional[T] + from __future__ import annotations instead of T | None syntax which requires Python 3.10+. Co-Authored-By: Claude Sonnet 4.6 --- core/queue_db.py | 6 ++++-- core/vector.py | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/core/queue_db.py b/core/queue_db.py index bf63083..67ab215 100644 --- a/core/queue_db.py +++ b/core/queue_db.py @@ -1,13 +1,15 @@ """Oracle ADB connection pool and CRUD operations for knowledge_queue.""" +from __future__ import annotations + import json import os from contextlib import contextmanager -from typing import Generator +from typing import Generator, Optional import oracledb -_pool: oracledb.ConnectionPool | None = None +_pool: Optional[oracledb.ConnectionPool] = None def _get_pool() -> oracledb.ConnectionPool: diff --git a/core/vector.py b/core/vector.py index 8c4ff4f..5b53891 100644 --- a/core/vector.py +++ b/core/vector.py @@ -1,9 +1,11 @@ """Embedding generation and Oracle vector store insertion.""" +from __future__ import annotations + import array import os from contextlib import contextmanager -from typing import Generator +from typing import Generator, Optional import oci import oracledb @@ -14,7 +16,7 @@ from oci.generative_ai_inference.models import ( ) # Reuse same pool as queue_db but connect to same ADB instance -_pool: oracledb.ConnectionPool | None = None +_pool: Optional[oracledb.ConnectionPool] = None def _get_pool() -> oracledb.ConnectionPool: