Skip to content

Commit 297056a

Browse files
committed
formatting and linting
1 parent df0003e commit 297056a

File tree

3 files changed

+11
-5
lines changed

3 files changed

+11
-5
lines changed

_test_unstructured_client/unit_utils.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
import pathlib
56
from typing import Any
67
from unittest.mock import (
78
ANY,
@@ -31,6 +32,12 @@
3132
"property_mock",
3233
)
3334

35+
def sample_docs_path(file_name: str) -> str:
36+
"""Resolve the absolute-path to `file_name` in the sample-docs directory."""
37+
sample_docs_dir = pathlib.Path(__file__).parent / "_sample_docs"
38+
file_path = sample_docs_dir / file_name
39+
return str(file_path.resolve())
40+
3441

3542
# ------------------------------------------------------------------------------------------------
3643
# MOCKING FIXTURES

src/unstructured_client/_hooks/custom/form_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import logging
44
from pathlib import Path
5-
from typing import TYPE_CHECKING
5+
from typing import TYPE_CHECKING, Mapping
66
from typing_extensions import TypeAlias
77

88
from requests_toolbelt.multipart.decoder import MultipartDecoder # type: ignore
@@ -14,7 +14,7 @@
1414
from typing import Union
1515

1616
logger = logging.getLogger(UNSTRUCTURED_CLIENT_LOGGER_NAME)
17-
FormData: TypeAlias = "dict[str, Union[str, shared.Files, list[str]]]"
17+
FormData: TypeAlias = "Mapping[str, Union[str, shared.Files, list[str]]]"
1818

1919
PARTITION_FORM_FILES_KEY = "files"
2020
PARTITION_FORM_SPLIT_PDF_PAGE_KEY = "split_pdf_page"

src/unstructured_client/_hooks/custom/split_pdf_hook.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ def _get_pdf_chunk_paths(
548548
return pdf_chunk_paths
549549

550550
def _get_pdf_chunk_files(
551-
self, pdf_chunks: list[Tuple[Path, int]]
551+
self, pdf_chunks: list[Tuple[Path, int]]
552552
) -> Generator[Tuple[BinaryIO, int], None, None]:
553553
"""Yields the file objects for the given pdf chunk paths.
554554
@@ -575,8 +575,7 @@ def _get_pdf_chunk_files(
575575
raise
576576
yield pdf_chunk_file, offset
577577

578-
def _await_elements(
579-
self, operation_id: str) -> Optional[list]:
578+
def _await_elements(self, operation_id: str) -> Optional[list]:
580579
"""
581580
Waits for the partition requests to complete and returns the flattened
582581
elements.

0 commit comments

Comments
 (0)