Skip to content

Commit 8e2ffdc

Browse files
authored
Better type fix (#598)
1 parent d70f2d4 commit 8e2ffdc

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

libs/knowledge-store/ragstack_knowledge_store/graph_store.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,8 @@ def _serialize_metadata(md: Dict[str, Any]) -> str:
5959
def _serialize_links(links: Set[Link]) -> str:
6060
class SetAndLinkEncoder(json.JSONEncoder):
6161
def default(self, obj: Any) -> Any:
62-
if is_dataclass(obj):
63-
# TODO: Mypy false positive: https://github.com/python/mypy/issues/17550
64-
return asdict(obj) # type: ignore[call-overload]
62+
if is_dataclass(obj) and not isinstance(obj, type):
63+
return asdict(obj)
6564

6665
try:
6766
iterable = iter(obj)

0 commit comments

Comments
 (0)