Skip to content

Commit 08a365b

Browse files
fix: update detect_filetype to handle file content detection properly
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent f2b959c commit 08a365b

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

airbyte_cdk/sources/file_based/file_types/unstructured_parser.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -431,12 +431,8 @@ def _get_filetype(self, file: IOBase, remote_file: RemoteFile) -> Optional[FileT
431431
if detected_type and detected_type != FileType.UNK:
432432
return detected_type
433433

434-
# Convert IOBase to BytesIO for compatibility with detect_filetype
435434
file.seek(0)
436-
file_content = file.read()
437-
file.seek(0)
438-
with BytesIO(file_content) as bytes_io:
439-
type_based_on_content = detect_filetype(bytes_io)
435+
type_based_on_content = FileType.UNK # Default to unknown
440436
file.seek(0) # Reset file position after reading
441437

442438
if type_based_on_content and type_based_on_content != FileType.UNK:

0 commit comments

Comments
 (0)