From 342270d6e5b92a7197505da177473c89dcdcd1b8 Mon Sep 17 00:00:00 2001 From: igorls <4753812+igorls@users.noreply.github.com> Date: Mon, 27 Apr 2026 03:15:09 -0300 Subject: [PATCH] fix(palace_graph): defer annotation eval for Python 3.9 compat MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ``def _normalize_wing(wing: str | None) -> str | None`` uses PEP 604 union syntax which requires Python 3.10+ at runtime. The project still declares ``python_requires=">=3.9"`` and CI runs the test-linux (3.9) matrix, where every test in ``tests/test_palace_graph*`` errors out before collection with ``TypeError: unsupported operand type(s) for |``. Added ``from __future__ import annotations`` so all annotations in this module are evaluated lazily as strings — the union syntax is then accepted on 3.9 without needing to rewrite to ``Optional[str]``. Surfaced after rebasing this PR onto current develop. --- mempalace/palace_graph.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/mempalace/palace_graph.py b/mempalace/palace_graph.py index 5e6ccbf..3296cd5 100644 --- a/mempalace/palace_graph.py +++ b/mempalace/palace_graph.py @@ -15,6 +15,11 @@ Enables queries like: No external graph DB needed — built from ChromaDB metadata. """ +# PEP 604 (``str | None``) needs 3.10+ at runtime; the project still +# supports 3.9, so defer annotation evaluation to keep the union syntax +# working on the older interpreter. +from __future__ import annotations + import hashlib import json import logging