community[patch]: refactor the type hint of `file_path` in `UnstructuredAPIFileLoader` class (#18839)

* **Description**: add `None` type for `file_path` along with `str` and
`List[str]` types.
* `file_path`/`filename` arguments in `get_elements_from_api()` and
`partition()` can be `None`, however, there's no `None` type hint for
`file_path` in `UnstructuredAPIFileLoader` and `UnstructuredFileLoader`
currently.
* calling the function with `file_path=None` is no problem, but my IDE
annoys me lol.
* **Issue**: N/A
* **Dependencies**: N/A

Co-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>
pull/15298/head^2
Hyeongchan Kim 3 months ago committed by GitHub
parent cf96060ab7
commit 9b70131aed
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -156,7 +156,7 @@ class UnstructuredFileLoader(UnstructuredBaseLoader):
def __init__(
self,
file_path: Union[str, List[str], Path, List[Path]],
file_path: Union[str, List[str], Path, List[Path], None],
mode: str = "single",
**unstructured_kwargs: Any,
):
@ -255,7 +255,7 @@ class UnstructuredAPIFileLoader(UnstructuredFileLoader):
def __init__(
self,
file_path: Union[str, List[str]] = "",
file_path: Union[str, List[str], None] = "",
mode: str = "single",
url: str = "https://api.unstructured.io/general/v0/general",
api_key: str = "",

Loading…
Cancel
Save