Skip to content

build(deps): version bumps for maintenance #420

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 14 commits into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 0.0.69

* Bump to `unstructured` 0.14.4
* Add handling for `pdf_infer_table_structure` to reflect the "tables off by default" behavior in `unstructured`.

## 0.0.68

* Fix list params such as `extract_image_block_types` not working via the python/js clients
Expand All @@ -20,7 +25,7 @@
* Bump unstructured to 0.12.4
* Add support for both `list[str]` and `str` input formats for `ocr_languages` parameter
* Adds support for additional MIME types from `unstructured`
* Document the support for gzip files and add additional testing
* Document the support for gzip files and add additional testing

## 0.0.64

Expand Down
2 changes: 1 addition & 1 deletion prepline_general/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
app = FastAPI(
title="Unstructured Pipeline API",
summary="Partition documents with the Unstructured library",
version="0.0.68",
version="0.0.69",
docs_url="/general/docs",
openapi_url="/general/openapi.json",
servers=[
Expand Down
21 changes: 15 additions & 6 deletions prepline_general/api/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,11 @@ def pipeline_api(

hi_res_model_name = _validate_hi_res_model_name(hi_res_model_name, coordinates)
strategy = _validate_strategy(strategy)
pdf_infer_table_structure = _set_pdf_infer_table_structure(pdf_infer_table_structure, strategy)
pdf_infer_table_structure = _set_pdf_infer_table_structure(
pdf_infer_table_structure,
strategy,
skip_infer_table_types,
)

# Parallel mode is set by env variable
enable_parallel_mode = os.environ.get("UNSTRUCTURED_PARALLEL_MODE_ENABLED", "false")
Expand Down Expand Up @@ -441,9 +445,9 @@ def pipeline_api(
)
elif hi_res_model_name and hi_res_model_name in CHIPPER_MODEL_TYPES:
with ChipperMemoryProtection():
elements = partition(**partition_kwargs) # pyright: ignore[reportGeneralTypeIssues]
elements = partition(**partition_kwargs) # type: ignore # pyright: ignore[reportGeneralTypeIssues]
else:
elements = partition(**partition_kwargs) # pyright: ignore[reportGeneralTypeIssues]
elements = partition(**partition_kwargs) # type: ignore # pyright: ignore[reportGeneralTypeIssues]

except OSError as e:
if isinstance(e.args[0], str) and (
Expand Down Expand Up @@ -595,8 +599,13 @@ def _validate_chunking_strategy(chunking_strategy: Optional[str]) -> Optional[st
return chunking_strategy


def _set_pdf_infer_table_structure(pdf_infer_table_structure: bool, strategy: str) -> bool:
def _set_pdf_infer_table_structure(
pdf_infer_table_structure: bool, strategy: str, skip_infer_table_types: Optional[List[str]]
) -> bool:
"""Avoids table inference in "fast" and "ocr_only" runs."""
# NOTE(robinson) - line below is for type checking
skip_infer_table_types = [] if skip_infer_table_types is None else skip_infer_table_types
pdf_infer_table_structure = pdf_infer_table_structure and ("pdf" not in skip_infer_table_types)
return strategy in ("hi_res", "auto") and pdf_infer_table_structure


Expand Down Expand Up @@ -704,7 +713,7 @@ def return_content_type(filename: str):


@router.get("/general/v0/general", include_in_schema=False)
@router.get("/general/v0.0.68/general", include_in_schema=False)
@router.get("/general/v0.0.69/general", include_in_schema=False)
async def handle_invalid_get_request():
raise HTTPException(
status_code=status.HTTP_405_METHOD_NOT_ALLOWED, detail="Only POST requests are supported."
Expand All @@ -719,7 +728,7 @@ async def handle_invalid_get_request():
description="Description",
operation_id="partition_parameters",
)
@router.post("/general/v0.0.68/general", include_in_schema=False)
@router.post("/general/v0.0.69/general", include_in_schema=False)
def general_partition(
request: Request,
# cannot use annotated type here because of a bug described here:
Expand Down
2 changes: 1 addition & 1 deletion preprocessing-pipeline-family.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
name: general
version: 0.0.68
version: 0.0.69
2 changes: 1 addition & 1 deletion requirements/base.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
-c constraints.in
unstructured[local-inference]>=0.8.1
unstructured[all-docs]>=0.8.1
# Pinning click due to a unicode issue in black
# can remove after black drops support for Python 3.6
# ref: https://github.com/psf/black/issues/2964
Expand Down
Loading