From bc64a11abc935ab6b8a105146f642337460f81e5 Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Wed, 17 Dec 2025 13:27:20 +0000 Subject: [PATCH] Fixing schema API problems --- trustgraph-base/trustgraph/base/pulsar_backend.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/trustgraph-base/trustgraph/base/pulsar_backend.py b/trustgraph-base/trustgraph/base/pulsar_backend.py index d6d6d1d1..144a48ba 100644 --- a/trustgraph-base/trustgraph/base/pulsar_backend.py +++ b/trustgraph-base/trustgraph/base/pulsar_backend.py @@ -76,8 +76,11 @@ def dict_to_dataclass(data: dict, cls: type) -> Any: # Handle generic types like list[T] or dict[K, V] if actual_type.__origin__ == list: item_type = actual_type.__args__[0] if actual_type.__args__ else None - if item_type and is_dataclass(item_type): - kwargs[key] = [dict_to_dataclass(item, item_type) for item in value] + if item_type and is_dataclass(item_type) and isinstance(value, list): + kwargs[key] = [ + dict_to_dataclass(item, item_type) if isinstance(item, dict) else item + for item in value + ] else: kwargs[key] = value else: