Skip to content

Commit 5594c29

Browse files
fix: resolve mypy error by casting IOBase to IO[bytes] for detect_filetype
Co-Authored-By: unknown <>
1 parent 763050f commit 5594c29

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

airbyte_cdk/sources/file_based/file_types/unstructured_parser.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
import traceback
77
from datetime import datetime
88
from io import BytesIO, IOBase
9-
from typing import Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union
9+
from typing import IO, Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast
1010

1111
import backoff
1212
import dpath
@@ -424,7 +424,7 @@ def _get_filetype(self, file: IOBase, remote_file: RemoteFile) -> Optional[FileT
424424
if file_type and file_type != FileType.UNK:
425425
return file_type
426426

427-
type_based_on_content = detect_filetype(file=file)
427+
type_based_on_content = detect_filetype(file=cast(IO[bytes], file))
428428
file.seek(0) # detect_filetype is reading to read the file content, so we need to reset
429429

430430
if type_based_on_content and type_based_on_content != FileType.UNK:

0 commit comments

Comments
 (0)