Skip to content

Commit

Permalink
Fix type hints for python 3.7-3.9
Browse files Browse the repository at this point in the history
  • Loading branch information
FredHaa committed Dec 22, 2023
1 parent ae3cbba commit 758d1fe
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mediacatch_s2t/uploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ class Uploader:
CHUNK_SIZE = 100 * 1024 * 1024 # 100 MB
REQUEST_RETRY_LIMIT = 3

def __init__(self, file: str, api_key: str, quota: str | None = None, max_threads: int = 5) -> None:
def __init__(self, file: str, api_key: str, quota: Optional[str] = None, max_threads: int = 5) -> None:
self.file_path = Path(file)
if not self.file_path.is_file():
raise FileNotFoundError(f"The file {file} does not exist")

Check warning on line 45 in src/mediacatch_s2t/uploader.py

View check run for this annotation

Codecov / codecov/patch

src/mediacatch_s2t/uploader.py#L43-L45

Added lines #L43 - L45 were not covered by tests
Expand Down Expand Up @@ -201,7 +201,7 @@ def _is_response_successful(response: requests.Response) -> bool:
"""
return 200 <= response.status_code < 300

Check warning on line 202 in src/mediacatch_s2t/uploader.py

View check run for this annotation

Codecov / codecov/patch

src/mediacatch_s2t/uploader.py#L202

Added line #L202 was not covered by tests

def upload_and_get_transcription(file: str, api_key: str, quota: str | None = None) -> dict[str, str]:
def upload_and_get_transcription(file: str, api_key: str, quota: Optional[str] = None) -> dict[str, str]:
"""Uploads a file and returns its transcription.
Args:
Expand Down

0 comments on commit 758d1fe

Please sign in to comment.