Skip to content

Commit 0ad233d

Browse files
committed
Fix potential KeyError by using get() for target_accession_assembly in get_scoreset_metadata
1 parent 085d011 commit 0ad233d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/dcd_mapping/mavedb_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ def get_scoreset_metadata(
220220
target_gene_name=gene["name"],
221221
target_gene_category=gene["category"],
222222
target_accession_id=target_accession_id,
223-
target_accession_assembly=target_gene_accession["assembly"],
223+
target_accession_assembly=target_gene_accession.get("assembly"),
224224
)
225225
except (KeyError, ValidationError) as e:
226226
msg = f"Unable to extract metadata from API response for scoreset {scoreset_urn}: {e}"

0 commit comments

Comments
 (0)