35 lines
1.2 KiB
Python
35 lines
1.2 KiB
Python
import json
|
|
import sys
|
|
import subprocess
|
|
|
|
sys.stdout.reconfigure(encoding='utf-8')
|
|
|
|
# Run git diff between 02544795 and HEAD for work_item_master_2026-01-01.json
|
|
cmd = ["git", "diff", "02544795", "HEAD", "--", "resources/data_work_item_master/work_item_master_2026-01-01.json"]
|
|
res = subprocess.run(cmd, capture_output=True, text=True, encoding='utf-8')
|
|
|
|
diff_lines = res.stdout.splitlines()
|
|
print(f"Total diff lines in work_item_master: {len(diff_lines)}")
|
|
|
|
# Parse what tables changed
|
|
# Look for pum_table_id context
|
|
changed_tables = {}
|
|
cur_tid = None
|
|
cur_changes = []
|
|
|
|
for l in diff_lines:
|
|
if '"pum_table_id":' in l:
|
|
m = l.split('"pum_table_id":')[1].strip().replace('"', '').replace(',', '')
|
|
cur_tid = m
|
|
if cur_tid not in changed_tables:
|
|
changed_tables[cur_tid] = []
|
|
if (l.startswith('+') or l.startswith('-')) and not l.startswith('+++') and not l.startswith('---'):
|
|
if cur_tid:
|
|
changed_tables[cur_tid].append(l)
|
|
|
|
print(f"Number of tables with diffs: {len(changed_tables)}")
|
|
for tid, chs in list(changed_tables.items())[:15]:
|
|
print(f"\n[{tid}] changes ({len(chs)} lines):")
|
|
for c in chs[:4]:
|
|
print(f" {c}")
|