Skip to content

Commit 5bdba3b

Browse files
committed
release: prepare v1.4.1
1 parent 57e4cb6 commit 5bdba3b

4 files changed

Lines changed: 48 additions & 11 deletions

File tree

‎CLI-COMMANDS.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,8 @@ roboflow annotation job admin-list -p my-project --limit 50
181181
roboflow annotation job admin-get <job-id> -p my-project
182182
roboflow annotation job admin-create -p my-project --batch <batch-id> \
183183
--labeler a@co.com --reviewer b@co.com --name "Label round 1"
184+
roboflow annotation job reassign-images -p my-project --image-id <image-id> \
185+
--labeler a@co.com --yes
184186
roboflow annotation job create -p my-project --name "Label round 1" \
185187
--batch <batch-id> --num-images 100 --labeler a@co.com --reviewer b@co.com
186188
roboflow annotation job images <job-id> -p my-project

‎roboflow/__init__.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
CLIPModel = None # type: ignore[assignment,misc]
2222
GazeModel = None # type: ignore[assignment,misc]
2323

24-
__version__ = "1.4.0"
24+
__version__ = "1.4.1"
2525

2626

2727
def check_key(api_key, model, notebook, num_retries=0):

‎roboflow/cli/handlers/annotation.py‎

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -268,18 +268,21 @@ def job_reassign_images(
268268
reviewer: Annotated[Optional[str], typer.Option(help="Reviewer email")] = None,
269269
instructions: Annotated[Optional[str], typer.Option(help="Labeling instructions")] = None,
270270
name: Annotated[Optional[str], typer.Option(help="Optional job name")] = None,
271+
yes: Annotated[bool, typer.Option("-y", "--yes", help="Confirm reassignment of the images")] = False,
271272
) -> None:
272273
"""Create a job by explicitly reassigning images."""
273-
_simple_command(
274-
ctx_to_args(ctx, project=project),
275-
"reassign_annotation_job_images",
276-
image_ids=image_ids,
277-
labeler_email=labeler,
278-
reviewer_email=reviewer,
279-
instructions=instructions,
280-
name=name,
281-
success="Reassigned images to a new annotation job.",
282-
)
274+
args = ctx_to_args(ctx, project=project, yes=yes)
275+
if _confirm(args, "Remove these images from their current assignments and reassign them to a new job?"):
276+
_simple_command(
277+
args,
278+
"reassign_annotation_job_images",
279+
image_ids=image_ids,
280+
labeler_email=labeler,
281+
reviewer_email=reviewer,
282+
instructions=instructions,
283+
name=name,
284+
success="Reassigned images to a new annotation job.",
285+
)
283286

284287

285288
@job_app.command("add-images")

‎tests/cli/test_annotation_handler.py‎

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,38 @@ def test_job_add_images_requires_yes_non_interactively(self, _resolve, mock_api)
422422
self.assertEqual(result.exit_code, 0, result.output)
423423
mock_api.assert_called_once_with("key", "ws", "proj", "job-1", image_ids=["image-1"])
424424

425+
@patch("roboflow.adapters.rfapi.reassign_annotation_job_images")
426+
@patch(_RESOLVE, return_value=("key", "ws", "proj"))
427+
def test_job_reassign_images_requires_yes_non_interactively(self, _resolve, mock_api):
428+
command = [
429+
"annotation",
430+
"job",
431+
"reassign-images",
432+
"-p",
433+
"ws/proj",
434+
"--image-id",
435+
"image-1",
436+
"--labeler",
437+
"labeler@example.com",
438+
]
439+
result = runner.invoke(app, command)
440+
self.assertEqual(result.exit_code, 1)
441+
mock_api.assert_not_called()
442+
443+
mock_api.return_value = {"jobId": "job-1"}
444+
result = runner.invoke(app, [*command, "--yes"])
445+
self.assertEqual(result.exit_code, 0, result.output)
446+
mock_api.assert_called_once_with(
447+
"key",
448+
"ws",
449+
"proj",
450+
image_ids=["image-1"],
451+
labeler_email="labeler@example.com",
452+
reviewer_email=None,
453+
instructions=None,
454+
name=None,
455+
)
456+
425457
@patch("roboflow.adapters.rfapi.accept_annotation_job_images")
426458
@patch(_RESOLVE, return_value=("key", "ws", "proj"))
427459
def test_job_accept_maps_lists_and_split_counts(self, _resolve, mock_api):

0 commit comments

Comments
 (0)