From 63ef381f9866d2cdf802e8b15337c69fe0d4e303 Mon Sep 17 00:00:00 2001 From: Evan Morris Date: Mon, 11 Dec 2023 15:39:45 -0500 Subject: [PATCH] adding better error message for node norm 422 respones, decreasing # of curies sent to bl lookup --- Common/normalization.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/normalization.py b/Common/normalization.py index e4eb1b9b..f2dfab1a 100644 --- a/Common/normalization.py +++ b/Common/normalization.py @@ -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() @@ -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.