From bd86fcdd659d0e2be4fa8de0d7664a2c0cf61203 Mon Sep 17 00:00:00 2001 From: Gaurav Vaidya Date: Fri, 23 Aug 2024 21:32:11 -0400 Subject: [PATCH] Added check for empty compendium file. --- node_normalizer/loader.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/node_normalizer/loader.py b/node_normalizer/loader.py index 3f518b2..43d48c8 100644 --- a/node_normalizer/loader.py +++ b/node_normalizer/loader.py @@ -526,6 +526,9 @@ async def load_compendium(self, compendium_filename: str, block_size: int) -> bo logger.info(f"{line_counter} {compendium_filename} total lines processed") + if line_counter == 0: + raise RuntimeError(f"Compendium file {compendium_filename} is empty.") + print(f"Done loading {compendium_filename}...") except Exception as e: logger.error(f"Exception thrown in load_compendium({compendium_filename}), line {line_counter}: {e}")