Skip to content

Commit

Permalink
Fix static analysis issue.
Browse files Browse the repository at this point in the history
  • Loading branch information
keyurva committed Dec 9, 2024
1 parent 48373e1 commit 0c749a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions tools/sdg/topics/generate_topic_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -222,10 +222,11 @@ def _to_triple(parser_triple: list[str], local2dcid: dict[str, str]) -> Triple:
return Triple(subject_id, _predicate, object_value=value)


def _filter_triples_by_type(triples: list[Triple], type: str) -> list[Triple]:
def _filter_triples_by_type(triples: list[Triple],
type_of: str) -> list[Triple]:
filter_dcids = set()
for triple in triples:
if triple.predicate == _PREDICATE_TYPE_OF and triple.object_id == type:
if triple.predicate == _PREDICATE_TYPE_OF and triple.object_id == type_of:
filter_dcids.add(triple.subject_id)

return list(filter(lambda triple: triple.subject_id in filter_dcids, triples))
Expand Down

0 comments on commit 0c749a0

Please sign in to comment.