Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jul 16, 2024
1 parent 57ad287 commit 437e375
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/metakb/query.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,6 @@ def _deserialize_field(node: dict, field_name: str) -> None | dict:
return None


def _uniqify_list(item_list: list) -> list:
seen = set()
return [x for x in item_list if not (x in seen or seen.add(x))]


class QueryHandler:
"""Primary query-handling class. Wraps database connections and hooks to external
services such as the concept normalizers.
Expand Down Expand Up @@ -889,7 +884,7 @@ async def batch_search_studies(
with self.driver.session() as session:
result = session.run(query, v_ids=variation_ids, skip=start, limit=limit)
study_nodes = [r[0] for r in result]
response.study_ids = _uniqify_list([n["id"] for n in study_nodes])
response.study_ids = [n["id"] for n in study_nodes]
studies = self._get_nested_studies(study_nodes)
response.studies = [VariantTherapeuticResponseStudy(**s) for s in studies]
return response

0 comments on commit 437e375

Please sign in to comment.