Skip to content

Commit

Permalink
style: resolve mypy errors (#369)
Browse files Browse the repository at this point in the history
  • Loading branch information
korikuzma authored Oct 9, 2023
1 parent 11a6c37 commit f812375
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion therapy/etl/drugsatfda.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ def get_latest_version(self) -> str:
raise DownloadException(msg)
return date
else:
raise requests.HTTPError("Unable to retrieve version from FDA API")
raise requests.HTTPError(
"Unable to retrieve version from FDA API", response=requests.Response()
)

def _load_meta(self) -> None:
"""Add Drugs@FDA metadata."""
Expand Down
12 changes: 7 additions & 5 deletions therapy/schemas.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
"""This module contains data models for representing VICC therapy records."""
from typing import List, Optional, Dict, Union, Any, Type, Set
from typing import List, Optional, Dict, Union, Any, Type, Set, Literal
from enum import Enum, IntEnum
from datetime import datetime

from ga4gh.vrsatile.pydantic.core_models import CURIE
from ga4gh.vrsatile.pydantic.vrsatile_models import TherapeuticDescriptor
from pydantic import BaseModel, StrictBool
from pydantic import BaseModel, StrictBool, StrictStr

from therapy.version import __version__

Expand Down Expand Up @@ -395,10 +395,12 @@ def schema_extra(schema: Dict[str, Any], model: Type["MatchesListed"]) -> None:
class ServiceMeta(BaseModel):
"""Metadata regarding the therapy-normalization service."""

name = "thera-py"
version = __version__
name: Literal["thera-py"] = "thera-py"
version: StrictStr = __version__
response_datetime: datetime
url = "https://github.com/cancervariants/therapy-normalization"
url: Literal[
"https://github.com/cancervariants/therapy-normalization"
] = "https://github.com/cancervariants/therapy-normalization"

class Config:
"""Configure OpenAPI schema"""
Expand Down

0 comments on commit f812375

Please sign in to comment.