fix param types for partition_image and _pdf (#2988)

Make the `filename` and `file` params for `partition_image` and
`partition_pdf` match the other partitioners
This commit is contained in:
John 2024-05-08 22:02:43 -05:00 committed by GitHub
parent b64a48440d
commit e15adb418b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 15 additions and 5 deletions

View File

@ -1,3 +1,13 @@
## 0.13.8-dev0
### Enhancements
### Features
### Fixes
* **Make the filename and file params for partition_image and partition_pdf match the other partitioners**
## 0.13.7 ## 0.13.7
### Enhancements ### Enhancements

View File

@ -1 +1 @@
__version__ = "0.13.7" # pragma: no cover __version__ = "0.13.8-dev0" # pragma: no cover

View File

@ -1,6 +1,6 @@
from __future__ import annotations from __future__ import annotations
from typing import Any, Optional from typing import IO, Any, Optional
from unstructured.chunking import add_chunking_strategy from unstructured.chunking import add_chunking_strategy
from unstructured.documents.elements import Element, process_metadata from unstructured.documents.elements import Element, process_metadata
@ -17,8 +17,8 @@ from unstructured.partition.utils.constants import PartitionStrategy
@add_metadata @add_metadata
@add_chunking_strategy @add_chunking_strategy
def partition_image( def partition_image(
filename: str = "", filename: Optional[str] = None,
file: Optional[bytes] = None, file: Optional[IO[bytes]] = None,
include_page_breaks: bool = False, include_page_breaks: bool = False,
infer_table_structure: bool = False, infer_table_structure: bool = False,
ocr_languages: Optional[str] = None, ocr_languages: Optional[str] = None,

View File

@ -117,7 +117,7 @@ def default_hi_res_model() -> str:
@add_metadata_with_filetype(FileType.PDF) @add_metadata_with_filetype(FileType.PDF)
@add_chunking_strategy @add_chunking_strategy
def partition_pdf( def partition_pdf(
filename: str = "", filename: Optional[str] = None,
file: Optional[IO[bytes]] = None, file: Optional[IO[bytes]] = None,
include_page_breaks: bool = False, include_page_breaks: bool = False,
strategy: str = PartitionStrategy.AUTO, strategy: str = PartitionStrategy.AUTO,