diff --git a/darwin/importer/importer.py b/darwin/importer/importer.py index 888a6d35a..97a20eed8 100644 --- a/darwin/importer/importer.py +++ b/darwin/importer/importer.py @@ -1482,7 +1482,7 @@ def _overwrite_warning( """ files_to_overwrite = [] for local_file in local_files: - item_id = remote_files.get(local_file.full_path)[0] + item_id = remote_files.get(local_file.full_path)["item_id"] remote_annotations = client.api_v2._get_remote_annotations( item_id, dataset.team, diff --git a/tests/darwin/importer/importer_test.py b/tests/darwin/importer/importer_test.py index 5351d098d..a290a0203 100644 --- a/tests/darwin/importer/importer_test.py +++ b/tests/darwin/importer/importer_test.py @@ -843,7 +843,18 @@ def test_overwrite_warning_proceeds_with_import(): remote_path="/", ), ] - remote_files = {"/file1": ("id1", "path1"), "/file2": ("id2", "path2")} + remote_files = { + "/file1": { + "item_id": "id1", + "slot_names": ["0"], + "layout": {"type": "simple", "version": 1, "slots": ["0"]}, + }, + "/file2": { + "item_id": "id2", + "slot_names": ["0"], + "layout": {"type": "simple", "version": 1, "slots": ["0"]}, + }, + } console = MagicMock() with patch("builtins.input", return_value="y"): @@ -887,7 +898,18 @@ def test_overwrite_warning_aborts_import(): remote_path="/", ), ] - remote_files = {"/file1": ("id1", "path1"), "/file2": ("id2", "path2")} + remote_files = { + "/file1": { + "item_id": "id1", + "slot_names": ["0"], + "layout": {"type": "simple", "version": 1, "slots": ["0"]}, + }, + "/file2": { + "item_id": "id2", + "slot_names": ["0"], + "layout": {"type": "simple", "version": 1, "slots": ["0"]}, + }, + } console = MagicMock() with patch("builtins.input", return_value="n"):