Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add helper method in event #2332

Merged
merged 2 commits into from
Jul 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Change images docker superduper/<image> to superduperio/<image>
- 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

Expand Down
4 changes: 4 additions & 0 deletions superduper/base/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@ class Event:
identifier: str
id: t.Any
event_type: str

def dict(self):
"""Convert to dict."""
return dc.asdict(self)
2 changes: 1 addition & 1 deletion superduper/components/listener.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
2 changes: 1 addition & 1 deletion superduper/components/vector_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
]
Expand Down
Loading