Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

style: resolve mypy errors #368

Merged
merged 1 commit into from
Oct 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion therapy/etl/drugsatfda.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,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
10 changes: 6 additions & 4 deletions therapy/schemas.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from ga4gh.vrsatile.pydantic import return_value
from ga4gh.vrsatile.pydantic.vrs_models import CURIE
from ga4gh.vrsatile.pydantic.vrsatile_models import ValueObjectDescriptor
from pydantic import BaseModel, StrictBool, validator
from pydantic import BaseModel, StrictBool, StrictStr, validator

from therapy.version import __version__

Expand Down Expand Up @@ -395,10 +395,12 @@ class TherapyDescriptor(ValueObjectDescriptor):
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