Let callers keep an annotated image out of the Dataset - #531
Open
iurisilvio wants to merge 1 commit into
Open
iurisilvio wants to merge 1 commit into
iurisilvio wants to merge 1 commit into
Conversation
`POST /dataset/:id/annotate/:image` adds the image to the project's Dataset unless the request sends `addToDataset=false`, and `save_annotation` had no way to send it. Uploading an annotation for an image that is still waiting to be labeled or reviewed in a batch therefore pulled it out of that flow and into the Dataset, where the next dataset version picked it up. `add_to_dataset` is threaded through `single_upload`, `Project.save_annotation` and `rfapi.save_annotation`. It defaults to `None`, which omits the parameter and leaves today's behavior untouched; `False` opts out. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this does
POST /dataset/:id/annotate/:imageadds the image to the project's Dataset unless therequest sends
addToDataset=false, andsave_annotationbuilds its URL without eversending that parameter:
So uploading an annotation for an image that is still waiting to be labeled or reviewed in
a batch pulls it out of that flow and into the Dataset, where the next dataset version picks
it up. A user hit this last week: a script annotated a batch through the SDK and 160 images
turned up in the project's Dataset with nothing approved. The Roboflow MCP server avoids it
by sending
addToDataset=falseexplicitly; SDK callers had no equivalent.add_to_datasetis now threaded throughsingle_upload→Project.save_annotation→rfapi.save_annotation→_save_annotation_url:Nothing changes for existing callers. The default is
None, which omits the parameterentirely and leaves the API's own default (add the image) in charge. Only an explicit
False/TrueputsaddToDataseton the query string.The endpoint's parameters are being documented on the API side in
roboflow/roboflow#16018.
Testing
TestSaveAnnotationUrlintests/test_rfapi.py:add_to_datasetleavesaddToDatasetoff the URL, so existing callers uploadexactly what they upload today;
FalseandTrueeach produce the matching query value;jobName,predictionandoverwrite.pytest tests/ --ignore=tests/manual— 1045 passed, 1 skipped.ruff format --check,ruff checkandmypy robofloware clean (mypy reports the same 8 pre-existingmissing-stub errors as
master).🤖 Generated with Claude Code