resume starts fresh if the first run didn't happen

This commit is contained in:
Nathan TeBlunthuis 2025-12-13 15:41:44 -08:00
parent 2c54425726
commit d7f5abef2d

View File

@ -1288,17 +1288,13 @@ def main():
print("Output files exist but are corrupt, deleting and starting fresh.", file=sys.stderr)
for filepath in corrupt_files:
os.remove(filepath)
start_fresh = True
else:
sys.exit(f"Error: --resume specified but partitioned output not found in: {partition_dir}")
start_fresh = True
else:
if os.path.exists(output_file):
# File exists but is corrupt - start fresh
print(f"Output file {output_file} exists but is corrupt, starting fresh.", file=sys.stderr)
os.remove(output_file)
start_fresh = True
else:
sys.exit(f"Error: --resume specified but output file not found: {output_file}")
start_fresh = True
else:
sys.exit("Error: --resume only works with parquet output (not stdout or TSV)")