mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Resolved mypy check error
This commit is contained in:
parent
9731c86a90
commit
9cbeb28f06
1 changed files with 3 additions and 3 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue