From 8a0d2ae659627d27f1734b3ce04e0c227cdb6d26 Mon Sep 17 00:00:00 2001 From: thejumpman2323 Date: Fri, 19 Jul 2024 16:03:11 +0530 Subject: [PATCH 1/2] Add helper method in event --- superduper/base/event.py | 4 ++++ superduper/components/listener.py | 2 +- superduper/components/vector_index.py | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/superduper/base/event.py b/superduper/base/event.py index 52da63980..712b561c8 100644 --- a/superduper/base/event.py +++ b/superduper/base/event.py @@ -16,3 +16,7 @@ class Event: identifier: str id: t.Any event_type: str + + def dict(self): + """Convert to dict.""" + return dc.asdict(self) diff --git a/superduper/components/listener.py b/superduper/components/listener.py index b26f79c49..b18daae36 100644 --- a/superduper/components/listener.py +++ b/superduper/components/listener.py @@ -202,7 +202,7 @@ def schedule_jobs( type_id=self.type_id, identifier=self.identifier, event_type=DBEvent.insert, - id=id, + id=str(id), ) for id in ids ] diff --git a/superduper/components/vector_index.py b/superduper/components/vector_index.py index f47ad4fcd..bbfe04904 100644 --- a/superduper/components/vector_index.py +++ b/superduper/components/vector_index.py @@ -291,7 +291,7 @@ def schedule_jobs( type_id=self.type_id, identifier=self.identifier, event_type=DBEvent.insert, - id=id, + id=str(id), ) for id in ids ] From 6c97a516d98b348e19d54ab65e095a8a1757d1c7 Mon Sep 17 00:00:00 2001 From: thejumpman2323 Date: Fri, 19 Jul 2024 16:22:21 +0530 Subject: [PATCH 2/2] Udate changelog --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0736f231f..6ec05ad2c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Change images docker superduper/ to superduperio/ - Change the image's user from `/home/superduperdb` to `/home/superduper` - Add message broker service config +- Add helper dict method in Event #### New Features & Functionality