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: