Skip to content

Commit a62f8c0

Browse files
authored
Fix 90 key error (#91)
1 parent b05b916 commit a62f8c0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

src/aind_data_asset_indexer/codeocean_bucket_indexer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,9 +93,9 @@ def _map_external_list_to_dict(external_recs: List[dict]) -> dict:
9393
"""
9494
new_records = dict()
9595
for r in external_recs:
96-
location = r["location"]
96+
location = r.get("source")
9797
rec_id = r["id"]
98-
if new_records.get(location) is not None:
98+
if location is not None and new_records.get(location) is not None:
9999
old_id_set = new_records.get(location)
100100
old_id_set.add(rec_id)
101101
new_records[location] = old_id_set

tests/test_codeocean_bucket_indexer.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ def setUpClass(cls) -> None:
102102
]
103103

104104
cls.example_temp_endpoint_response = [
105-
{"id": "abc-123", "location": "s3://bucket/prefix1"},
106-
{"id": "def-456", "location": "s3://bucket/prefix1"},
107-
{"id": "ghi-789", "location": "s3://bucket/prefix2"},
105+
{"id": "abc-123", "source": "s3://bucket/prefix1"},
106+
{"id": "def-456", "source": "s3://bucket/prefix1"},
107+
{"id": "ghi-789", "source": "s3://bucket/prefix2"},
108108
]
109109

110110
@patch("requests.get")

0 commit comments

Comments
 (0)