From f280ebcfc7febd1685ada0fa4714895d1df24b52 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Thu, 22 Aug 2024 00:20:24 -0400 Subject: [PATCH 1/2] fix/fix mypy error in generate job [This job}(https://github.com/Unstructured-IO/unstructured-python-client/actions/runs/10501696789/job/29092112690) failed due to a `import-not-found` error from mypy. --- src/unstructured_client/_hooks/custom/split_pdf_hook.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unstructured_client/_hooks/custom/split_pdf_hook.py b/src/unstructured_client/_hooks/custom/split_pdf_hook.py index 8627333f..ccd6e12d 100644 --- a/src/unstructured_client/_hooks/custom/split_pdf_hook.py +++ b/src/unstructured_client/_hooks/custom/split_pdf_hook.py @@ -76,7 +76,7 @@ async def run_tasks(coroutines: list[Coroutine], allow_failed: bool = False) -> def context_is_uvloop(): """Return true if uvloop is installed and we're currently in a uvloop context. Our asyncio splitting code currently doesn't work under uvloop.""" try: - import uvloop # pylint: disable=import-outside-toplevel + import uvloop # pylint: disable=import-outside-toplevel # type: ignore loop = asyncio.get_event_loop() return isinstance(loop, uvloop.Loop) except (ImportError, RuntimeError): From dcb8c2f25135b73bd2032d7234a4a7731d99b695 Mon Sep 17 00:00:00 2001 From: Austin Walker Date: Thu, 22 Aug 2024 11:38:23 -0400 Subject: [PATCH 2/2] Bump retry timeout in new test This can sometimes exhaust the retry timeout and return a 502. --- _test_unstructured_client/integration/test_decorators.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/_test_unstructured_client/integration/test_decorators.py b/_test_unstructured_client/integration/test_decorators.py index 4b47a948..f901f9f5 100644 --- a/_test_unstructured_client/integration/test_decorators.py +++ b/_test_unstructured_client/integration/test_decorators.py @@ -337,7 +337,7 @@ async def mock_send(_, request): sdk = UnstructuredClient( api_key_auth=FAKE_KEY, server_url="localhost:8000", - retry_config=RetryConfig("backoff", BackoffStrategy(200, 1000, 1.5, 1000), False), + retry_config=RetryConfig("backoff", BackoffStrategy(200, 1000, 1.5, 10000), False), ) filename = "_sample_docs/layout-parser-paper.pdf"