Skip to content

Commit 7b5685c

Browse files
committed
Tring to resolving mypy error of ci
Signed-off-by: Akshat Kumar <akshat230405@gmail.com>
1 parent 323d97c commit 7b5685c

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

src/google/adk/sessions/__init__.py

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15+
from __future__ import annotations
16+
17+
from typing import Any
18+
1519
from typing_extensions import override
1620

1721
from .base_session_service import BaseSessionService
@@ -26,35 +30,36 @@
2630
# This handles the case where optional dependencies (like sqlalchemy)
2731
# are not installed. A placeholder class ensures the symbol is always
2832
# 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]
3035
"""Placeholder for DatabaseSessionService when dependencies are not installed."""
3136

3237
_ERROR_MESSAGE = (
3338
'DatabaseSessionService requires sqlalchemy>=2.0, please ensure it is'
3439
' installed correctly.'
3540
)
3641

37-
def __init__(self, *args, **kwargs):
42+
def __init__(self, *args: Any, **kwargs: Any) -> None:
3843
raise ImportError(self._ERROR_MESSAGE)
3944

4045
@override
41-
async def create_session(self, *args, **kwargs):
46+
async def create_session(self, *args: Any, **kwargs: Any) -> Any:
4247
raise ImportError(self._ERROR_MESSAGE)
4348

4449
@override
45-
async def get_session(self, *args, **kwargs):
50+
async def get_session(self, *args: Any, **kwargs: Any) -> Any:
4651
raise ImportError(self._ERROR_MESSAGE)
4752

4853
@override
49-
async def list_sessions(self, *args, **kwargs):
54+
async def list_sessions(self, *args: Any, **kwargs: Any) -> Any:
5055
raise ImportError(self._ERROR_MESSAGE)
5156

5257
@override
53-
async def delete_session(self, *args, **kwargs):
58+
async def delete_session(self, *args: Any, **kwargs: Any) -> Any:
5459
raise ImportError(self._ERROR_MESSAGE)
5560

5661
@override
57-
async def append_event(self, *args, **kwargs):
62+
async def append_event(self, *args: Any, **kwargs: Any) -> Any:
5863
raise ImportError(self._ERROR_MESSAGE)
5964

6065

0 commit comments

Comments
 (0)