Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Pyright errors #281

Merged
merged 1 commit into from
May 16, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion nextstrain/cli/runner/aws_batch/s3.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from os import utime
from pathlib import Path
from time import struct_time
from typing import Callable, Generator, Iterable, List, Optional
from typing import Callable, Generator, Iterable, List, Optional, Any
from urllib.parse import urlparse
from zipfile import ZipFile, ZipInfo
from ...types import S3Bucket, S3Object
Expand Down Expand Up @@ -65,6 +65,7 @@ def upload_workdir(workdir: Path, bucket: S3Bucket, run_id: str) -> S3Object:
])

# Stream writes directly to the remote ZIP file
remote_file: Any
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the future, we may consider creating type stubs for fsspec so that we can provide the correct type instead of Any.

with fsspec.open(object_url(remote_workdir), "wb", auto_mkdir = False) as remote_file:
with ZipFile(remote_file, "w") as zipfile:
for path in walk(workdir, excluded):
Expand Down Expand Up @@ -108,6 +109,7 @@ def download_workdir(remote_workdir: S3Object, workdir: Path, patterns: List[str
selected = lambda path: True

# Open a seekable handle to the remote ZIP file…
remote_file: Any
with fsspec.open(object_url(remote_workdir)) as remote_file:

# …and extract its contents to the workdir.
Expand Down