From ae433448de2cbe813b1fae7e1e8c72d6b0c7e288 Mon Sep 17 00:00:00 2001 From: SimonTaurus Date: Sun, 5 Apr 2026 05:47:35 +0200 Subject: [PATCH 1/2] fix: restore __hash__ on OOFieldInfo to prevent TypeError in typing module OOFieldInfo overrides __eq__ for query building, which makes Python set __hash__ = None. This breaks third-party libraries (e.g. prefect) that process Union/Annotated types containing FieldInfo metadata, since typing needs to hash them. Restore id()-based hashing matching the original object.__hash__ behavior. --- src/oold/model/__init__.py | 3 +++ src/oold/model/v1/__init__.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/src/oold/model/__init__.py b/src/oold/model/__init__.py index ae208cb..4f3956e 100644 --- a/src/oold/model/__init__.py +++ b/src/oold/model/__init__.py @@ -72,6 +72,9 @@ def __gt__(self, other): def __ge__(self, other): return Condition(field=self.name, operator="ge", value=other) + def __hash__(self): + return id(self) + pydantic.fields.FieldInfo = OOFieldInfo diff --git a/src/oold/model/v1/__init__.py b/src/oold/model/v1/__init__.py index bd9bca6..5f463c7 100644 --- a/src/oold/model/v1/__init__.py +++ b/src/oold/model/v1/__init__.py @@ -74,6 +74,9 @@ def __gt__(self, other): def __ge__(self, other): return Condition(field=self.name, operator="ge", value=other) + def __hash__(self): + return id(self) + pydantic.v1.fields.FieldInfo = OOFieldInfo From 87185a6b75c0e36569ac7b8b2bec90aba8853e30 Mon Sep 17 00:00:00 2001 From: SimonTaurus Date: Sun, 5 Apr 2026 06:20:55 +0200 Subject: [PATCH 2/2] fix: nullify all *-suffixed keys in transform compact step Previously only uppercase *-keys (type mappings) were nullified in the first compact step, leaving lowercase *-keys like name* to compete with internal _-prefixed terms for the same IRI. pyld 3.0.0 removed _compare_shortest_least which changed term selection priority, causing *-keys to win over _-prefixed names and breaking the alias collapse. Nullify all *-keys so the algorithm does not depend on pyld's internal term ranking order. Refs: https://github.com/digitalbazaar/pyld/issues/247 --- src/oold/utils/transform.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/oold/utils/transform.py b/src/oold/utils/transform.py index 2640a93..a7775e3 100644 --- a/src/oold/utils/transform.py +++ b/src/oold/utils/transform.py @@ -82,10 +82,8 @@ def jsonld_to_jsonld(graph: dict, transformation_context: dict) -> dict: temp1["_" + temp1_value["@id"].replace(":", "_")] = temp1_value temp2["_" + temp1_value["@id"].replace(":", "_")] = temp2_value - # asume type mapping if key starts with capital letter - if key[0].isupper(): - temp1[key] = None - # temp3[org_key] = None + temp1[key] = None + # temp3[org_key] = None print("temp1", temp1) print("temp2", temp2)