Skip to content

Commit ee2de79

Browse files
github-actions[bot]speakeasybotawalker4
authored
chore: 🐝 Update SDK - Generate (Unstructured-IO#114)
> [!IMPORTANT] > Linting report available at: <https://app.speakeasyapi.dev/org/unstructured/unstructured5xr/linting-report/c1fec31921ab085211de39f108a9ca23> > OpenAPI Change report available at: <https://app.speakeasyapi.dev/org/unstructured/unstructured5xr/changes-report/a757f2f00046b6a6e109d6fcfb1abc22> # SDK update Based on: - OpenAPI Doc - Speakeasy CLI 1.308.1 (2.342.6) https://github.com/speakeasy-api/speakeasy ## OpenAPI Change Summary ``` ├─┬Info │ └──[🔀] version (1:80) ├─┬Paths │ └─┬/general/v0/general │ └─┬POST │ └─┬Responses │ ├──[➕] codes (1:1207) │ └─┬200 │ └─┬application/json │ └─┬Schema │ └──[➕] description (1:957) └─┬Components ├──[➕] schemas (1:10240) ├─┬partition_parameters │ ├─┬ocr_languages │ │ └──[🔀] description (1:4062) │ ├─┬xml_keep_tags │ │ └──[🔀] description (1:6020) │ ├─┬unique_element_ids │ │ └──[🔀] description (1:5728) │ ├─┬gz_uncompressed_content_type │ │ └──[🔀] description (1:3238) │ ├─┬include_page_breaks │ │ └──[🔀] description (1:3589) │ ├─┬coordinates │ │ └──[🔀] description (1:2526) │ ├─┬chunking_strategy │ │ └──[🔀] description (1:6380) │ ├─┬languages │ │ └──[🔀] description (1:3801) │ └─┬extract_image_block_types │ └──[🔀] description (1:2948) └─┬HTTPValidationError ├──[➖] title (1:1374) ├──[➕] example (1:1594) └─┬detail ├──[➖] items (1:1259)❌ ├──[➖] type (1:1317)❌ ├──[➖] title (1:1335) ├──[➕] oneOf (1:1482) └──[➕] oneOf (1:1560) ``` | Document Element | Total Changes | Breaking Changes | |------------------|---------------|------------------| | info | 1 | 0 | | paths | 2 | 0 | | components | 17 | 2 | ## PYTHON CHANGELOG ## unions: 2.82.8 - 2024-06-10 ### 🐛 Bug Fixes - ensure union type definitions define types in a way compatible with multiple python versions *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 4.6.11 - 2024-06-14 ### 👷 Build System - fixed indentation as tabs in python makefile *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* ## core: 4.6.10 - 2024-06-13 ### 👷 Build System - move to new method of publishing for python *(commit by [@TristanSpeakEasy](https://github.com/tristanspeakeasy))* --------- Co-authored-by: speakeasybot <[email protected]> Co-authored-by: Austin Walker <[email protected]>
1 parent 26b7892 commit ee2de79

18 files changed

+135
-51
lines changed

.speakeasy/gen.lock

+12-8
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
lockVersion: 2.0.0
22
id: 8b5fa338-9106-4734-abf0-e30d67044a90
33
management:
4-
docChecksum: 2cabb51a37782b691a9f16fbbf8df52b
5-
docVersion: 1.0.33
6-
speakeasyVersion: 1.300.1
7-
generationVersion: 2.339.1
8-
releaseVersion: 0.23.3
9-
configChecksum: 91a382013e2cda44b21c580620de3424
4+
docChecksum: 5365c99c52e23b044ef9916ecf51b1a9
5+
docVersion: 1.0.35
6+
speakeasyVersion: 1.308.1
7+
generationVersion: 2.342.6
8+
releaseVersion: 0.23.4
9+
configChecksum: 2f71ba62e42129740d3fe7343a6e3d57
1010
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
1111
repoSubDirectory: .
1212
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
@@ -15,7 +15,7 @@ features:
1515
python:
1616
additionalDependencies: 0.1.0
1717
constsAndDefaults: 0.1.3
18-
core: 4.6.9
18+
core: 4.6.11
1919
examples: 2.81.3
2020
globalSecurity: 2.83.5
2121
globalSecurityCallbacks: 0.1.0
@@ -28,13 +28,14 @@ features:
2828
retries: 2.82.2
2929
sdkHooks: 0.1.0
3030
serverIDs: 2.81.1
31-
unions: 2.82.7
31+
unions: 2.82.8
3232
generatedFiles:
3333
- src/unstructured_client/sdkconfiguration.py
3434
- src/unstructured_client/general.py
3535
- src/unstructured_client/sdk.py
3636
- py.typed
3737
- pylintrc
38+
- scripts/publish.sh
3839
- setup.py
3940
- src/unstructured_client/__init__.py
4041
- src/unstructured_client/utils/__init__.py
@@ -44,6 +45,7 @@ generatedFiles:
4445
- src/unstructured_client/models/errors/sdkerror.py
4546
- src/unstructured_client/models/operations/partition.py
4647
- src/unstructured_client/models/errors/httpvalidationerror.py
48+
- src/unstructured_client/models/errors/servererror.py
4749
- src/unstructured_client/models/shared/validationerror.py
4850
- src/unstructured_client/models/shared/partition_parameters.py
4951
- src/unstructured_client/models/shared/security.py
@@ -53,7 +55,9 @@ generatedFiles:
5355
- src/unstructured_client/models/shared/__init__.py
5456
- docs/models/operations/partitionrequest.md
5557
- docs/models/operations/partitionresponse.md
58+
- docs/models/errors/detail.md
5659
- docs/models/errors/httpvalidationerror.md
60+
- docs/models/errors/servererror.md
5761
- docs/models/shared/loc.md
5862
- docs/models/shared/validationerror.md
5963
- docs/models/shared/chunkingstrategy.md

.speakeasy/workflow.lock

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
1-
speakeasyVersion: 1.300.1
1+
speakeasyVersion: 1.308.1
22
sources:
33
my-source:
44
sourceNamespace: my-source
5-
sourceRevisionDigest: sha256:a621cbff6995a7d971a973cc7abe784ebf6f6cd5da0c305c06cc1759674cf95a
6-
sourceBlobDigest: sha256:c4508c75038ffde557290925e80d31c169551a1f1ef948833ff7779d63c6881a
5+
sourceRevisionDigest: sha256:2afe2b4cc03c9cec18d5b1b183a58d9d215c4741446a4deac25700bdb98a7aeb
6+
sourceBlobDigest: sha256:5f8888fc7a7d4dd77922a6607261d2b76bb51c2aeda36e98a33d4c3cbdf40f5e
77
tags:
88
- latest
99
- main
1010
targets:
1111
unstructured-python:
1212
source: my-source
1313
sourceNamespace: my-source
14-
sourceRevisionDigest: sha256:a621cbff6995a7d971a973cc7abe784ebf6f6cd5da0c305c06cc1759674cf95a
15-
sourceBlobDigest: sha256:c4508c75038ffde557290925e80d31c169551a1f1ef948833ff7779d63c6881a
14+
sourceRevisionDigest: sha256:2afe2b4cc03c9cec18d5b1b183a58d9d215c4741446a4deac25700bdb98a7aeb
15+
sourceBlobDigest: sha256:5f8888fc7a7d4dd77922a6607261d2b76bb51c2aeda36e98a33d4c3cbdf40f5e
1616
outLocation: /github/workspace/repo
1717
workflow:
1818
workflowVersion: 1.0.0

RELEASES.md

+11-1
Original file line numberDiff line numberDiff line change
@@ -514,4 +514,14 @@ Based on:
514514
### Generated
515515
- [python v0.23.3] .
516516
### Releases
517-
- [PyPI v0.23.3] https://pypi.org/project/unstructured-client/0.23.3 - .
517+
- [PyPI v0.23.3] https://pypi.org/project/unstructured-client/0.23.3 - .
518+
519+
## 2024-06-15 00:20:16
520+
### Changes
521+
Based on:
522+
- OpenAPI Doc
523+
- Speakeasy CLI 1.308.1 (2.342.6) https://github.com/speakeasy-api/speakeasy
524+
### Generated
525+
- [python v0.23.4] .
526+
### Releases
527+
- [PyPI v0.23.4] https://pypi.org/project/unstructured-client/0.23.4 - .

_test_unstructured_client/integration/test_integration_freemium.py

+11-4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,12 @@
11
import asyncio
2+
import json
23
import os
34
from pathlib import Path
45

56
import pytest
67
from unstructured_client import UnstructuredClient
78
from unstructured_client.models import shared
8-
from unstructured_client.models.errors.sdkerror import SDKError
9+
from unstructured_client.models.errors import SDKError, ServerError, HTTPValidationError
910
from unstructured_client.utils.retries import BackoffStrategy, RetryConfig
1011

1112

@@ -52,14 +53,20 @@ def event_loop():
5253

5354

5455
@pytest.mark.parametrize("split_pdf", [True, False])
55-
@pytest.mark.parametrize("error_code", [500, 403])
56-
def test_partition_handling_server_error(error_code, split_pdf, monkeypatch, doc_path, event_loop):
56+
@pytest.mark.parametrize("error", [(500, ServerError), (403, SDKError), (422, HTTPValidationError)])
57+
def test_partition_handling_server_error(error, split_pdf, monkeypatch, doc_path, event_loop):
5758
filename = "layout-parser-paper-fast.pdf"
5859
import httpx
5960
from unstructured_client.sdkconfiguration import requests_http
6061

62+
error_code, sdk_raises = error
63+
6164
response = requests_http.Response()
6265
response.status_code = error_code
66+
response.headers = {'Content-Type': 'application/json'}
67+
json_data = {"detail": "An error occurred"}
68+
response._content = bytes(json.dumps(json_data), 'utf-8')
69+
6370
monkeypatch.setattr(requests_http.Session, "send", lambda *args, **kwargs: response)
6471
monkeypatch.setattr(httpx.AsyncClient, "send", lambda *args, **kwargs: response)
6572

@@ -82,5 +89,5 @@ def test_partition_handling_server_error(error_code, split_pdf, monkeypatch, doc
8289
split_pdf_page=split_pdf,
8390
)
8491

85-
with pytest.raises(SDKError, match=f"API error occurred: Status {error_code}"):
92+
with pytest.raises(sdk_raises):
8693
response = client.general.partition(req)

docs/models/errors/detail.md

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Detail
2+
3+
4+
## Supported Types
5+
6+
###
7+
8+
```python
9+
detail: List[shared.ValidationError] = /* values here */
10+
```
11+
12+
###
13+
14+
```python
15+
detail: str = /* values here */
16+
```
17+

docs/models/errors/httpvalidationerror.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@
33

44
## Fields
55

6-
| Field | Type | Required | Description |
7-
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
8-
| `detail` | List[[shared.ValidationError](../../models/shared/validationerror.md)] | :heavy_minus_sign: | N/A |
6+
| Field | Type | Required | Description |
7+
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
8+
| `detail` | [Optional[errors.Detail]](../../models/errors/detail.md) | :heavy_minus_sign: | N/A |

docs/models/errors/servererror.md

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# ServerError
2+
3+
4+
## Fields
5+
6+
| Field | Type | Required | Description |
7+
| ------------------ | ------------------ | ------------------ | ------------------ |
8+
| `detail` | *Optional[str]* | :heavy_minus_sign: | N/A |

0 commit comments

Comments
 (0)