Skip to content

Commit

Permalink
fix disease references per PR suggestsions
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma committed Oct 26, 2023
1 parent cc704e9 commit 22a0938
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 3 additions & 3 deletions therapy/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import click
from botocore.exceptions import ClientError
from boto3.dynamodb.conditions import Key
from disease.database import Database as DiseaseDatabase
from disease.cli import CLI as DiseaseCLI
from disease.database.dynamodb import DynamoDbDatabase as DiseaseDatabase
from disease.cli import update_db as update_disease_db
from disease.schemas import SourceName as DiseaseSources

from therapy import SOURCES
Expand Down Expand Up @@ -134,7 +134,7 @@ def _check_disease_normalizer(self, normalizers: List[str],
logger.debug(msg)
click.echo(msg)
try:
DiseaseCLI().update_normalizer_db(
update_disease_db(
["--update_all", "--update_merged", "--db_url", endpoint_url]
)
except Exception as e:
Expand Down
4 changes: 3 additions & 1 deletion therapy/etl/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from pydantic import ValidationError
import requests
import bioversions
from disease.database.dynamodb import DynamoDbDatabase
from disease.query import QueryHandler as DiseaseNormalizer

from therapy import APP_ROOT, ITEM_TYPES, DownloadException
Expand Down Expand Up @@ -318,7 +319,8 @@ def __init__(self, database: Database, data_path: Path = DEFAULT_DATA_PATH):
:param Path data_path: path to normalizer data directory
"""
super().__init__(database, data_path)
self.disease_normalizer = DiseaseNormalizer(self.database.endpoint_url)
db = DynamoDbDatabase(self.database.endpoint_url)
self.disease_normalizer = DiseaseNormalizer(db)

@lru_cache(maxsize=64)
def _normalize_disease(self, query: str) -> Optional[str]:
Expand Down

0 comments on commit 22a0938

Please sign in to comment.