← back to Exo
fix
76f903504c3e4f8583cefc828b6c3c9569788406 · 2025-07-22 22:29:35 +0100 · Gelu Vrabie
Co-authored-by: Gelu Vrabie <gelu@exolabs.net>
Files touched
M shared/db/sqlite/connector.py
Diff
commit 76f903504c3e4f8583cefc828b6c3c9569788406
Author: Gelu Vrabie <gelu.vrabie.univ@gmail.com>
Date: Tue Jul 22 22:29:35 2025 +0100
fix
Co-authored-by: Gelu Vrabie <gelu@exolabs.net>
---
shared/db/sqlite/connector.py | 11 +----------
1 file changed, 1 insertion(+), 10 deletions(-)
diff --git a/shared/db/sqlite/connector.py b/shared/db/sqlite/connector.py
index 4b40cf9b..bdf34948 100644
--- a/shared/db/sqlite/connector.py
+++ b/shared/db/sqlite/connector.py
@@ -108,9 +108,8 @@ class AsyncSQLiteEventStorage:
event_data: dict[str, Any] = cast(dict[str, Any], json.loads(raw_event_data))
else:
event_data = cast(dict[str, Any], raw_event_data)
- event = await self._deserialize_event(event_data)
events.append(EventFromEventLog(
- event=event,
+ event=EventParser.validate_python(event_data),
origin=NodeId(uuid=UUID(origin)),
idx_in_log=rowid # rowid becomes idx_in_log
))
@@ -249,14 +248,6 @@ class AsyncSQLiteEventStorage:
self._logger.error(f"Failed to commit batch: {e}")
raise
- # TODO: This is a hack to get the event deserialization working. We need to find a better way to do this.
- async def _deserialize_event(self, event_data: dict[str, Any]) -> Event:
- """Deserialize event data back to typed Event."""
- # EventParser expects the discriminator field for proper deserialization
- result = EventParser.validate_python(event_data)
- # EventParser returns Event type which is our union of all event types
- return result
-
async def _deserialize_event_raw(self, event_data: dict[str, Any]) -> dict[str, Any]:
"""Return raw event data for testing purposes."""
return event_data
← cd9a1a91 Topology update
·
back to Exo
·
Implemented basic discovery library in Rust + python binding 8d2536d9 →