fixed type errors when pylance type checking mode is strict.
This commit is contained in:
@ -1,3 +1,5 @@
|
||||
from typing import Any
|
||||
|
||||
from pydantic.dataclasses import dataclass
|
||||
|
||||
from mdrsclient.models.utils import iso8601_to_user_friendly
|
||||
@ -11,7 +13,7 @@ class File:
|
||||
size: int
|
||||
thumbnail: str | None
|
||||
description: str
|
||||
metadata: dict
|
||||
metadata: dict[str, Any]
|
||||
download_url: str
|
||||
created_at: str
|
||||
updated_at: str
|
||||
|
@ -1,4 +1,4 @@
|
||||
from typing import Final, NamedTuple
|
||||
from typing import Any, Final, NamedTuple
|
||||
from unicodedata import normalize
|
||||
|
||||
from pydantic.dataclasses import dataclass
|
||||
@ -66,7 +66,7 @@ class FolderSimple:
|
||||
|
||||
@dataclass(frozen=True)
|
||||
class Folder(FolderSimple):
|
||||
metadata: list[dict]
|
||||
metadata: list[dict[str, Any]]
|
||||
sub_folders: list[FolderSimple]
|
||||
files: list[File]
|
||||
path: str
|
||||
|
@ -38,7 +38,7 @@ class Token:
|
||||
return (now + 10) > access_decoded.exp and (now - 10) < refresh_decoded.exp
|
||||
|
||||
def __decode(self, token: str) -> DecodedJWT:
|
||||
data = jwt.decode(token, options={"verify_signature": False})
|
||||
data = jwt.decode(token, options={"verify_signature": False}) # type: ignore
|
||||
return TypeAdapter(DecodedJWT).validate_python(data)
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user