Skip to content

Commit

Permalink
More mypy fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
fritzm committed Oct 24, 2023
1 parent 72c22ae commit 8303518
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
8 changes: 5 additions & 3 deletions src/lsst/cmservice/db/row.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from __future__ import annotations

from typing import Any, Sequence
from typing import Any, Sequence, TypeVar

from fastapi import HTTPException
from sqlalchemy import select
Expand All @@ -9,6 +9,8 @@

from ..common.enums import StatusEnum

T = TypeVar("T")

DELETEABLE_STATES = [
StatusEnum.failed,
StatusEnum.rejected,
Expand All @@ -30,10 +32,10 @@ class RowMixin:

@classmethod
async def get_rows(
cls,
cls: type[T],
session: async_scoped_session,
**kwargs: Any,
) -> Sequence[RowMixin]:
) -> Sequence[T]:
"""Get rows associated to a particular table
Parameters
Expand Down
2 changes: 1 addition & 1 deletion src/lsst/cmservice/handlers/elements.py
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ async def split(
parent: ElementMixin,
**kwargs: Any,
) -> AsyncGenerator:
raise NotImplementedError()
yield


class NoSplit(Splitter):
Expand Down
2 changes: 2 additions & 0 deletions src/lsst/cmservice/handlers/jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,8 @@ def _get_wms_svc(self, **kwargs: Any) -> BaseWmsService:
if self._wms_svc is None:
assert self.wms_svc_class_name
self._wms_svc_class = doImport(self.wms_svc_class_name)
if isinstance(self._wms_svc_class, types.ModuleType):
raise RuntimeError(f"Site class={self.wms_svc_class_name} is not a BaseWmsService subclass")
self._wms_svc = self._wms_svc_class(kwargs)
return self._wms_svc

Expand Down

0 comments on commit 8303518

Please sign in to comment.