Skip to content

Commit

Permalink
adding better error message for node norm 422 respones,
Browse files Browse the repository at this point in the history
decreasing # of curies sent to bl lookup
  • Loading branch information
EvanDietzMorris committed Dec 11, 2023
1 parent 79a8241 commit 63ef381
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Common/normalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ def normalize_node_data(self, node_list: list, block_size: int = 1000) -> list:
empty_responses = {curie: None for curie in data_chunk}
cached_node_norms.update(empty_responses)
else:
# the error that is trapped here means that the entire list of nodes didnt get normalized.
# we should never get a legitimate non-200 response from node norm here, just crash with an error
error_message = f'Node norm response code: {resp.status_code}'
if resp.status_code == 422:
error_message += f'(curies: {data_chunk})'
self.logger.error(error_message)
resp.raise_for_status()

Expand Down Expand Up @@ -367,7 +369,7 @@ def __init__(self,

def normalize_edge_data(self,
edge_list: list,
block_size: int = 2500) -> list:
block_size: int = 100) -> list:
"""
This method calls the EdgeNormalization web service to retrieve information for normalizing edges.
Expand Down

0 comments on commit 63ef381

Please sign in to comment.