Skip to content

Commit 906124e

Browse files
fix: resolve MyPy errors in unstructured_parser.py
Co-Authored-By: Aaron <AJ> Steers <[email protected]>
1 parent a791703 commit 906124e

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

airbyte_cdk/sources/file_based/file_types/unstructured_parser.py

Lines changed: 8 additions & 4 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 Any, Dict, Iterable, List, Mapping, Optional, Tuple, Union, cast
1010

1111
import backoff
1212
import dpath
@@ -331,10 +331,14 @@ def _read_file_remotely(
331331
data = self._params_to_dict(format.parameters, strategy)
332332

333333
mime_type = mimetypes.guess_type(f"file.{filetype.name.lower()}")[0] if filetype else "application/octet-stream"
334-
files = {"files": ("filename", file_handle, mime_type)}
335-
334+
335+
files = cast(Any, {"files": ("filename", file_handle, mime_type)})
336+
336337
response = requests.post(
337-
f"{format.api_url}/general/v0/general", headers=headers, data=data, files=files
338+
f"{format.api_url}/general/v0/general",
339+
headers=headers,
340+
data=data,
341+
files=files
338342
)
339343

340344
if response.status_code == 422:

0 commit comments

Comments
 (0)