Skip to content

Commit

Permalink
Run black
Browse files Browse the repository at this point in the history
  • Loading branch information
maximusunc committed Aug 25, 2023
1 parent 58db98f commit 5a5f587
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions strider/trapi.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ def fix_kedge(kedge: Edge, curie_map: dict[str, str]):
kedge.object = curie_map.get(kedge.object, [kedge.object])[0]


def fix_results(message: Message, curie_map: dict[str, str], kp_id: str, logger: logging.Logger):
def fix_results(
message: Message,
curie_map: dict[str, str],
kp_id: str,
logger: logging.Logger,
):
"""Replace curie with preferred, if possible."""
for result in message.results or []:
for qnode_id, node_bindings in result.node_bindings.items():
Expand All @@ -161,7 +166,9 @@ def fix_results(message: Message, curie_map: dict[str, str], kp_id: str, logger:
if node_binding.query_id is None:
continue
# set node binding query id to preferred prefix
query_id = curie_map.get(node_binding.query_id, [node_binding.query_id])[0]
query_id = curie_map.get(
node_binding.query_id, [node_binding.query_id]
)[0]
if node_binding.id == query_id:
# remove query_id if equivalent to id
logger.info(
Expand Down

0 comments on commit 5a5f587

Please sign in to comment.