|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
| 15 | +from __future__ import annotations |
| 16 | + |
| 17 | +from typing import Any |
| 18 | + |
15 | 19 | from typing_extensions import override |
16 | 20 |
|
17 | 21 | from .base_session_service import BaseSessionService |
|
26 | 30 | # This handles the case where optional dependencies (like sqlalchemy) |
27 | 31 | # are not installed. A placeholder class ensures the symbol is always |
28 | 32 | # available for documentation tools and static analysis. |
29 | | - class DatabaseSessionService(BaseSessionService): |
| 33 | + # We use type: ignore[no-redef, misc] to satisfy strict mypy checks. |
| 34 | + class DatabaseSessionService(BaseSessionService): # type: ignore[no-redef, misc] |
30 | 35 | """Placeholder for DatabaseSessionService when dependencies are not installed.""" |
31 | 36 |
|
32 | 37 | _ERROR_MESSAGE = ( |
33 | 38 | 'DatabaseSessionService requires sqlalchemy>=2.0, please ensure it is' |
34 | 39 | ' installed correctly.' |
35 | 40 | ) |
36 | 41 |
|
37 | | - def __init__(self, *args, **kwargs): |
| 42 | + def __init__(self, *args: Any, **kwargs: Any) -> None: |
38 | 43 | raise ImportError(self._ERROR_MESSAGE) |
39 | 44 |
|
40 | 45 | @override |
41 | | - async def create_session(self, *args, **kwargs): |
| 46 | + async def create_session(self, *args: Any, **kwargs: Any) -> Any: |
42 | 47 | raise ImportError(self._ERROR_MESSAGE) |
43 | 48 |
|
44 | 49 | @override |
45 | | - async def get_session(self, *args, **kwargs): |
| 50 | + async def get_session(self, *args: Any, **kwargs: Any) -> Any: |
46 | 51 | raise ImportError(self._ERROR_MESSAGE) |
47 | 52 |
|
48 | 53 | @override |
49 | | - async def list_sessions(self, *args, **kwargs): |
| 54 | + async def list_sessions(self, *args: Any, **kwargs: Any) -> Any: |
50 | 55 | raise ImportError(self._ERROR_MESSAGE) |
51 | 56 |
|
52 | 57 | @override |
53 | | - async def delete_session(self, *args, **kwargs): |
| 58 | + async def delete_session(self, *args: Any, **kwargs: Any) -> Any: |
54 | 59 | raise ImportError(self._ERROR_MESSAGE) |
55 | 60 |
|
56 | 61 | @override |
57 | | - async def append_event(self, *args, **kwargs): |
| 62 | + async def append_event(self, *args: Any, **kwargs: Any) -> Any: |
58 | 63 | raise ImportError(self._ERROR_MESSAGE) |
59 | 64 |
|
60 | 65 |
|
|
0 commit comments