try/catch opening original file in resume.
This commit is contained in:
parent
f427291fd8
commit
c6e96c2f54
@ -236,8 +236,14 @@ def merge_parquet_files(original_path, temp_path, merged_path):
|
|||||||
False if both sources were empty
|
False if both sources were empty
|
||||||
None if temp file is invalid (caller should keep original unchanged)
|
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:
|
try:
|
||||||
temp_pq = pq.ParquetFile(temp_path)
|
temp_pq = pq.ParquetFile(temp_path)
|
||||||
except Exception:
|
except Exception:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user