Repository navigation
Honor annotation_overwrite in per-image upload_dataset (REQ-182) - #552
Conversation
…icate log (LEN-122) The per-image flow never forwarded annotation_overwrite, so upload_dataset(annotation_overwrite=True) on a directory could not replace annotations on duplicate images. Resolve the default once for both flows and pass it to save_annotation. When the API keeps existing annotations (409 already annotated), log that instead of a bare WARN. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
e3dc6d3 to
4c7a529
Compare
…(LEN-122) Staging smoke: 'roboflow upload ./dir --annotation-overwrite' exited 2 with 'No such option'; only 'roboflow image upload' had the flag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
7d7cf03 to
05a32c2
Compare
…t (LEN-122 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
/jarbas review |
PR Review: Honor annotation_overwrite in per-image upload_dataset (REQ-182)
📋 SummaryThis PR correctly extends The duplicate-image message is also more actionable and accurately describes a 409 “already annotated” response as preserving the existing annotation. I found no merge-blocking issue in the current head. 🏗️ Architectural ReviewThe change follows the repository's existing layers and keeps responsibility in the right places: flowchart LR
CLI[image upload] --> Args[CLI args]
Alias[top-level upload] --> Args
Args --> Workspace[Workspace upload_dataset]
Workspace --> Default[Resolve project default]
Default --> Project[Project save_annotation]
Project --> API[Annotation API overwrite]
🐛 Code Quality IssuesNo critical, warning, or minor correctness findings. The public default remains backward compatible for non-classification projects ( 💡 Recommendations
🧪 TestsThe added and updated tests meaningfully cover the changed behavior:
I could not independently execute the targeted suite in the prepared environment because its system Python does not have ⚖️ Verdict — ✅ ApproveThe implementation is small, correctly layered, backward compatible, and directly covered across the CLI and per-image annotation path. The additional explicit- Generated by Codex via roboflow-review-pr. Review is advisory; verify before merging. Review completed: 2026-10-14 16:58:32 UTC |
Description
Customer problem: re-running
roboflow upload ./dirwith a COCO file that has no annotations looked like it wiped the boxes on images already in the project, and the CLI gave no way to choose (O8).What this PR solves:
roboflow upload ./dir --annotation-overwriteexited withNo such option, androboflow image upload ./dir --annotation-overwrite(andupload_dataset(..., annotation_overwrite=True)) ignored the flag outside the zip flow. Both now replace annotations on duplicates.annotations = WARN: already annotated. It now printsannotations = kept existing (pass --annotation-overwrite / annotation_overwrite=True to replace).Already fixed server-side: the wipe itself. Since roboflow#12836 (internal link removed) the API returns 409 on a duplicate that is already annotated unless
overwriteis set, so the boxes survive (confirmed on staging below).Type of change
How has this change been tested?
pytest tests/test_project.py -k PerImage4/4,tests/cli/test_image_handler.py -k three_states(now covers theuploadalias). Full suite 1234 passed.kept existing …); re-upload with--annotation-overwritereplaces them. Onmain: the log saysWARN: already annotated,image upload --annotation-overwriteleaves the boxes untouched, andupload --annotation-overwriteexits 2.image upload, and that the classification default had no test. All four are fixed and staging re-ran green after the fix.Any specific deployment considerations
None. SDK release only.
🤖 Generated with Claude Code