Skip to content

Commit

Permalink
fixed entity parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
yairsimantov20 committed Aug 6, 2023
1 parent 1725fd3 commit 3ea2d57
Showing 1 changed file with 6 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,12 @@ def order_by_entities_dependencies(entities: list[Entity]) -> list[Entity]:
entities_map[node(entity)] = entity

for entity in entities:
relation_target_ids: list[str] = sum(
[
identifier if isinstance(identifier, list) else [identifier]
for relation in entity.relations.values()
if relation is not None
for identifier in relation
],
[],
)
relation_target_ids: list[str] = [
identifier
for relation in entity.relations.values()
if relation is not None
for identifier in relation
]
related_entities = [
related for related in entities if related.identifier in relation_target_ids
]
Expand Down

0 comments on commit 3ea2d57

Please sign in to comment.