Skip to content

Commit

Permalink
Fix mypy
Browse files Browse the repository at this point in the history
  • Loading branch information
sharevb committed Nov 29, 2023
1 parent d650a22 commit e193115
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions transferwee.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
will be shared via emails or link.
"""

from typing import Any, List, Optional, Union, Dict
from typing import Any, List, Optional, Union, Dict, cast
import binascii
import functools
import hashlib
Expand Down Expand Up @@ -378,7 +378,10 @@ def _storm_prepare(authorization: str, filenames: List[str]) -> Dict[Any, Any]:
files_bids = [_storm_prepare_item(f) for f in filenames]

blocks = [i for sublist in files_bids for i in sublist]
response = {"ok": True, "data": {"blocks": []}}
response: Dict[str, Union[bool, Dict[str, List[Any]]]] = {
"ok": True,
"data": {"blocks": []},
}
chunk_size = 100
for i in range(0, len(blocks), chunk_size):
j = {
Expand Down Expand Up @@ -406,7 +409,9 @@ def _storm_prepare(authorization: str, filenames: List[str]) -> Dict[Any, Any]:
if not r_json["ok"]:
logger.error(r_json)
response["ok"] = response["ok"] and r_json["ok"]
response["data"]["blocks"] += r_json["data"]["blocks"]
cast(Dict[str, List], response["data"])["blocks"] += cast(
Dict[str, List], r_json["data"]
)["blocks"]

return {"files_bids": files_bids, "blocks": response}

Expand Down

0 comments on commit e193115

Please sign in to comment.