Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
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
5 changes: 3 additions & 2 deletions registry/sql-registry/registry/db_registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def _fill_entity(self, e: Entity) -> Entity:
return e

def _get_edges(self, ids: list[UUID], types: list[RelationshipType] = []) -> list[Edge]:
if not ids or not types:
if not ids:
return []
sql = fr"""select edge_id, from_id, to_id, conn_type from edges
where from_id in %(ids)s
Expand All @@ -415,9 +415,10 @@ def _get_edges(self, ids: list[UUID], types: list[RelationshipType] = []) -> lis
where conn_type in %(types)s
and from_id in %(ids)s
and to_id in %(ids)s"""

rows = self.conn.query(sql, {
"ids": tuple([str(id) for id in ids]),
"types": tuple([str(t) for t in types]),
"types": tuple([t.name for t in types]),
})
return list([_to_type(row, Edge) for row in rows])

Expand Down