From 9cbeb28f061c9fe9ce4c9c6b6ac63e642041cca2 Mon Sep 17 00:00:00 2001 From: Rishat Fayzullin Date: Mon, 11 Mar 2024 09:45:35 +0300 Subject: [PATCH] Resolved mypy check error --- aiogram/fsm/storage/mongo.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/aiogram/fsm/storage/mongo.py b/aiogram/fsm/storage/mongo.py index cef46c64..ceb2dfb3 100644 --- a/aiogram/fsm/storage/mongo.py +++ b/aiogram/fsm/storage/mongo.py @@ -1,4 +1,4 @@ -from typing import Any, Dict, Optional +from typing import Any, Dict, Optional, cast from motor.motor_asyncio import AsyncIOMotorClient, AsyncIOMotorCollection @@ -104,7 +104,7 @@ class MongoStorage(BaseStorage): if not document: return {} else: - return document # type: ignore + return cast(Dict[str, Any], document) async def update_data(self, key: StorageKey, data: Dict[str, Any]) -> Dict[str, Any]: document_id = self._key_builder.build(key, "data") @@ -117,4 +117,4 @@ class MongoStorage(BaseStorage): ) if not update_result: await self._data_collection.delete_one({"_id": document_id}) - return update_result # type: ignore + return cast(Dict[str, Any], update_result)