Skip to content

Commit

Permalink
fix: style and update deps
Browse files Browse the repository at this point in the history
  • Loading branch information
long2ice committed Nov 29, 2023
1 parent bd93072 commit 0f1d6dd
Show file tree
Hide file tree
Showing 2 changed files with 361 additions and 364 deletions.
8 changes: 2 additions & 6 deletions meilisync/source/postgres.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,19 +81,15 @@ def _consumer(self, msg: ReplicationMessage):
return
columnnames = change.get("columnnames")
columnvalues = change.get("columnvalues")

if kind == "update":
values = dict(zip(columnnames, columnvalues))
event_type = EventType.update
elif kind == "delete":
values = (
dict(zip(columnnames, columnvalues))
if columnvalues
else {
change["oldkeys"]["keynames"][0]: change["oldkeys"][
"keyvalues"
][0]
}
else {change["oldkeys"]["keynames"][0]: change["oldkeys"]["keyvalues"][0]}
)
event_type = EventType.delete
elif kind == "insert":
Expand Down
Loading

0 comments on commit 0f1d6dd

Please sign in to comment.