diff --git a/registry/sql-registry/registry/db_registry.py b/registry/sql-registry/registry/db_registry.py index 4361f3e91..58f4b98db 100644 --- a/registry/sql-registry/registry/db_registry.py +++ b/registry/sql-registry/registry/db_registry.py @@ -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 @@ -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])