Skip to content

Commit 576ecd1

Browse files
authored
Fix 4XX errors incorrectly categorized as 5XX in PDF splitting (#290)
All of the retry configs look like these: - [general.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/general.py#L217-L218): `retry_config = (retries, ["5xx"])` - [destinations.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/destinations.py#L182-L183): `retry_config = (retries, ["5xx"])` - [sources.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/sources.py#L183-L184): `retry_config = (retries, ["5xx"])` - [workflows.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/workflows.py#L75-76): `retry_config = (retries, ["5xx"])` - [jobs.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/jobs.py#L175-L176): `retry_config = (retries, ["5xx"])` - [users.py](https://github.com/Unstructured-IO/unstructured-python-client/blob/main/src/unstructured_client/users.py#L236-L236): `retry_config = (retries, ["5xx"])` This doesn't include all, but I do not see any cases where we would be retrying on a 4XX.
1 parent 1736ada commit 576ecd1

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/unstructured_client/_hooks/custom/split_pdf_hook.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -669,11 +669,8 @@ def after_success(
669669
elements = self._await_elements(operation_id)
670670

671671
# if fails are disallowed, return the first failed response
672-
# Note(austin): Stick a 500 status code in here so the SDK
673-
# does not trigger its own retry logic
674672
if not self.allow_failed and self.api_failed_responses.get(operation_id):
675673
failure_response = self.api_failed_responses[operation_id][0]
676-
failure_response.status_code = 500
677674

678675
self._clear_operation(operation_id)
679676
return failure_response

0 commit comments

Comments
 (0)