diff --git a/darwin/importer/importer.py b/darwin/importer/importer.py index d8d1dd605..14e56e5f5 100644 --- a/darwin/importer/importer.py +++ b/darwin/importer/importer.py @@ -1705,8 +1705,8 @@ def _warn_for_annotations_with_multiple_instance_ids( Warns the user if any video annotations have multiple unique instance IDs. This function checks each video annotation in the provided list of local annotation - files for multiple instance IDs. If any are found, a warning is printed to the console. - The user is then prompted to confirm if they want to proceed with the import. + files for multiple instance ID values. A warning is printed to the console for each + instance of this occurrence. Parameters ---------- @@ -1737,12 +1737,10 @@ def _warn_for_annotations_with_multiple_instance_ids( if files_with_multi_instance_id_annotations: console.print( - "The following files have at least one annotation with multiple instance IDs. Your team has static instance IDs enabled, so only the first instance ID of each annotation will be imported:", + "The following files have annotation(s) with multiple instance ID values. Only the first instance ID of each annotation will be imported:", style="warning", ) for file in files_with_multi_instance_id_annotations: console.print( f"- File: {file} has {files_with_multi_instance_id_annotations[file]} annotation(s) with multiple instance IDs" ) - if not secure_continue_request(): - raise SystemExit("Execution stopped by user.") diff --git a/tests/darwin/importer/importer_test.py b/tests/darwin/importer/importer_test.py index cf79e2214..19b51c858 100644 --- a/tests/darwin/importer/importer_test.py +++ b/tests/darwin/importer/importer_test.py @@ -1840,7 +1840,7 @@ def test_no_instance_id_warning_with_no_video_annotations(): console.print.assert_not_called() -def test_warning_with_multiple_files_with_multi_instance_id_annotations(monkeypatch): +def test_warning_with_multiple_files_with_multi_instance_id_annotations(): bounding_box_class = dt.AnnotationClass( name="class1", annotation_type="bounding_box" ) @@ -1931,10 +1931,7 @@ def test_warning_with_multiple_files_with_multi_instance_id_annotations(monkeypa ), ] console = MagicMock() - # Simulate the user stopping the export at the warning - monkeypatch.setattr("builtins.input", lambda _: "n") - with pytest.raises(SystemExit): - _warn_for_annotations_with_multiple_instance_ids(local_files, console) + _warn_for_annotations_with_multiple_instance_ids(local_files, console) console.print.assert_called() assert ( console.print.call_count == 3