From 53745878967b99489223d6d5eb1fe12618b2a431 Mon Sep 17 00:00:00 2001 From: James Stevenson Date: Thu, 4 Jan 2024 14:51:42 -0500 Subject: [PATCH] ugh --- src/gene/etl/ncbi.py | 3 +-- tests/unit/test_database_and_etl.py | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gene/etl/ncbi.py b/src/gene/etl/ncbi.py index 4fd18a1a..ebafed5b 100644 --- a/src/gene/etl/ncbi.py +++ b/src/gene/etl/ncbi.py @@ -173,7 +173,7 @@ def _get_gene_info(self, prev_symbols: Dict[str, str]) -> Dict[str, Dict]: vrs_chr_location = self._get_vrs_chr_location(row, params) except ValueError: # Exclude genes with multiple distinct locations (e.g. OMS) - pass + continue else: if vrs_chr_location: params["locations"] = vrs_chr_location @@ -340,7 +340,6 @@ def _set_chromosomes_locations(self, row: List[str], params: Dict) -> Dict: _logger.info( f"{row[2]} contains multiple distinct locations: {locations}." ) - locations = None raise ValueError # NCBI sometimes contains invalid map locations diff --git a/tests/unit/test_database_and_etl.py b/tests/unit/test_database_and_etl.py index 53666965..62a4154e 100644 --- a/tests/unit/test_database_and_etl.py +++ b/tests/unit/test_database_and_etl.py @@ -164,11 +164,11 @@ def test_get_all_records(db_fixture): is getting sent twice. """ source_records = list(db_fixture.db.get_all_records(RecordType.IDENTITY)) - assert len(source_records) == 64 + assert len(source_records) == 63 source_ids = {r["concept_id"] for r in source_records} - assert len(source_ids) == 64 + assert len(source_ids) == 63 normalized_records = list(db_fixture.db.get_all_records(RecordType.MERGER)) - assert len(normalized_records) == 47 + assert len(normalized_records) == 46 normalized_ids = {r["concept_id"] for r in normalized_records} - assert len(normalized_ids) == 47 + assert len(normalized_ids) == 46