Repository navigation
Fix batch QA report row parsing - #63
Conversation
Aaqibhafeezkhan
left a comment
There was a problem hiding this comment.
- Replaced the brittle fixed-width row detection with a dedicated
_qa_shot_counts()helper that correctly parses picked (*), flagged (x), and unmarked shot rows. - Added support for shot indexes with three or more digits, preventing valid rows from being incorrectly excluded.
- Updated the QA review threshold to account for explicitly flagged shots as well as
title-card?andrepeatflags. - Added regression tests covering mixed row markers, large shot indexes, flagged-shot thresholds, and reports containing no shot rows.
- Kept the changes focused on the existing QA parsing and curation flow without altering unrelated behavior.
The implementation addresses the reported parsing issue and includes regression coverage for the affected scenarios.
blixvip
left a comment
There was a problem hiding this comment.
Thanks @Aaqibhafeezkhan, this is very close. The regex parser is right, the three-digit index case is covered, and parsing the flags column as a set is better than the old substring check (it also catches short,repeat, which the old " repeat" test missed). I ran python -m unittest discover on your branch: 69 tests, all OK.
One thing to change before I merge:
Rows marked x shouldn't all count as bad. In sheet.report a row gets x whenever it has any flag, and that includes short (a shot under 1 second). The gate was only ever meant to trip on title-card? and repeat. Short shots are normal in a fast-cut movie, so with the match.group(2) == "x" clause a healthy pool where more than one sixth of the shots are short would be sent to NEEDS_REVIEW and skipped. The fix is one line in _qa_shot_counts:
- if match.group(2) == "x" or {"title-card?", "repeat"} & flag_set:
+ if {"title-card?", "repeat"} & flag_set:The tests then need these expectations (I tried this locally and it passes):
_shot_row(4, "*"),
+ _shot_row(5, "x", "short,repeat"),
_shot_row(105, "x", "repeat"),
])
- self.assertEqual(batch_edit._qa_shot_counts(report), (6, 3))
+ self.assertEqual(batch_edit._qa_shot_counts(report), (7, 3))and in the second test (3, 1) becomes (3, 0). The short row in the first test is worth keeping, because it now proves that a short shot alone doesn't count.
Optional, not blocking: a quote line that starts with a number (for example 300 men stood ...) also matches the row regex. Only counting rows after the idx id ... header line would rule that out.
Push that and I'll merge it straight away.
Aaqibhafeezkhan
left a comment
There was a problem hiding this comment.
Thanks for the review. I've addressed the feedback and pushed the updates:
- Updated the QA gate to count only
title-card?andrepeatflags as suspect shots. - Kept short-only shots valid while still detecting combined flags.
- Restricted row parsing to the shot table, preventing numeric text before the table from being misinterpreted.
- Added regression tests covering these cases, including three-digit indexes and reports without shot rows.
Please take another look. Thanks!
|
Thanks for the fix! Reviewed and merging. 🙏 |
Summary
Closes #51