From c6e96c2f54ab1afe866d118bb74ac4d20ee91521 Mon Sep 17 00:00:00 2001 From: Nathan TeBlunthuis Date: Wed, 10 Dec 2025 19:49:29 -0800 Subject: [PATCH] try/catch opening original file in resume. --- src/wikiq/resume.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/wikiq/resume.py b/src/wikiq/resume.py index a1fa37c..a1bbec0 100644 --- a/src/wikiq/resume.py +++ b/src/wikiq/resume.py @@ -236,8 +236,14 @@ def merge_parquet_files(original_path, temp_path, merged_path): False if both sources were empty None if temp file is invalid (caller should keep original unchanged) """ - original_pq = pq.ParquetFile(original_path) + try: + original_pq = pq.ParquetFile(original_path) + except Exception: + # Original file is invalid (empty or corrupted) + print(f"Note: No data in original file (namespace had no records or file was not properly written)", file=sys.stderr) + return None + try: temp_pq = pq.ParquetFile(temp_path) except Exception: