from pathlib import Path
import csv,json
root=Path(__file__).resolve().parent
rows=list(csv.reader(open(root/'raw-accurate/table-1.csv',newline='')))
expected=json.loads((root/'expected.json').read_text())
assert rows[0]==['sku','quantity','unit _price','note'], 'raw header changed; review again'
assert rows[1:]==expected['rows'], 'do not repair shifted data automatically'
rows[0][2]='unit_price'
with open(root/'reviewed-table.csv','w',newline='') as f:csv.writer(f).writerows(rows)
print('Manual schema review: renamed unit _price to unit_price; source amounts retained')
