Commit 0a61ff24 authored by Dario Barghini's avatar Dario Barghini
Browse files

Updated process_month to remove empty monthly data files

parent 76861f29
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -175,6 +175,9 @@ def process_monthly(root: Path, t0: dt.datetime, t1: dt.datetime) -> Tuple[int,
            newly_added_count = len(unique_rows) - len(existing_test_data)
            rows_moved += newly_added_count
            print(f"  {src_path.name}: moved {newly_added_count} new rows to {test_path.name}. Total test rows: {len(unique_rows)}")
            if not remaining_src_rows:
                os.remove(src_path)
                print(f"  Removed empty source file: {src_path.name}")
    return files_processed, rows_moved

# ---------------------------- Core logic: Revert ---------------------------------