Repository navigation
opus_tags: guard load_dialogue() against truncated CSV rows - #6596
Conversation
|
Tested 53b087a on Windows 11 (NTFS), Python 3.12.10 (CPU only, no GPU, no game files): pass What I ran:
Hand-made dialogue CSVs,
The change does what the description says: a row cut before Overlap: #5524 "opus_tags: reject dialogue rows without a wave" makes the same change in AI-assisted (Claude Code). |
|
Tested 53b087a merged with main 26ecd9f on Linux/Python 3.12.16: pass Commands run (merged worktree,
Diff read: a dialogue CSV row with fewer fields than the header leaves |
shayderrr
left a comment
There was a problem hiding this comment.
Summary
tools/opus_tags.py load_dialogue() now raises ValueError('<path>: line N is missing wave') when a CSV row lacks the wave column, instead of failing on None.lower(). A CLI test checks a truncated row returns exit 2 with one error line naming line 2, no traceback, and no tags written.
Why merge
Turns a raw attribute error into a precise, single-line diagnostic that names the bad row, keeping the tool's error contract intact.
Verdict: Approve
Summary
Why mergeTurns a raw attribute error into a precise, single-line diagnostic that names the bad row, keeping the tool's error contract intact. Verdict: Approve |
load_dialogue()intools/opus_tags.pycalledrow["wave"].lower()without checkingrow["wave"] is None, which raised an uncaughtAttributeErrortraceback when a truncated CSV row omitted thewavecolumn (for example, in a reordered CSV header). RaisesValueErrorwith the file path and line number, matchingload_names().Testing
python3.12 -m compileall -q tools/opus_tags.py tests/test_opus_tags.pypython3.12 -I tests/test_opus_tags.py -v(21/21 passed, including newtest_cli_dialogue_row_missing_wave_is_one_error_line)AI-assisted (Gemini 4 Hydrogen Medium).