Skip to content

Commit

Permalink
chore: 🐝 Update SDK - Generate (#114)
Browse files Browse the repository at this point in the history
> [!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]>
  • Loading branch information
3 people committed Jun 15, 2024
1 parent 26b7892 commit ee2de79
Show file tree
Hide file tree
Showing 18 changed files with 135 additions and 51 deletions.
20 changes: 12 additions & 8 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 8b5fa338-9106-4734-abf0-e30d67044a90
management:
docChecksum: 2cabb51a37782b691a9f16fbbf8df52b
docVersion: 1.0.33
speakeasyVersion: 1.300.1
generationVersion: 2.339.1
releaseVersion: 0.23.3
configChecksum: 91a382013e2cda44b21c580620de3424
docChecksum: 5365c99c52e23b044ef9916ecf51b1a9
docVersion: 1.0.35
speakeasyVersion: 1.308.1
generationVersion: 2.342.6
releaseVersion: 0.23.4
configChecksum: 2f71ba62e42129740d3fe7343a6e3d57
repoURL: https://github.com/Unstructured-IO/unstructured-python-client.git
repoSubDirectory: .
installationURL: https://github.com/Unstructured-IO/unstructured-python-client.git
Expand All @@ -15,7 +15,7 @@ features:
python:
additionalDependencies: 0.1.0
constsAndDefaults: 0.1.3
core: 4.6.9
core: 4.6.11
examples: 2.81.3
globalSecurity: 2.83.5
globalSecurityCallbacks: 0.1.0
Expand All @@ -28,13 +28,14 @@ features:
retries: 2.82.2
sdkHooks: 0.1.0
serverIDs: 2.81.1
unions: 2.82.7
unions: 2.82.8
generatedFiles:
- src/unstructured_client/sdkconfiguration.py
- src/unstructured_client/general.py
- src/unstructured_client/sdk.py
- py.typed
- pylintrc
- scripts/publish.sh
- setup.py
- src/unstructured_client/__init__.py
- src/unstructured_client/utils/__init__.py
Expand All @@ -44,6 +45,7 @@ generatedFiles:
- src/unstructured_client/models/errors/sdkerror.py
- src/unstructured_client/models/operations/partition.py
- src/unstructured_client/models/errors/httpvalidationerror.py
- src/unstructured_client/models/errors/servererror.py
- src/unstructured_client/models/shared/validationerror.py
- src/unstructured_client/models/shared/partition_parameters.py
- src/unstructured_client/models/shared/security.py
Expand All @@ -53,7 +55,9 @@ generatedFiles:
- src/unstructured_client/models/shared/__init__.py
- docs/models/operations/partitionrequest.md
- docs/models/operations/partitionresponse.md
- docs/models/errors/detail.md
- docs/models/errors/httpvalidationerror.md
- docs/models/errors/servererror.md
- docs/models/shared/loc.md
- docs/models/shared/validationerror.md
- docs/models/shared/chunkingstrategy.md
Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/workflow.lock
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
speakeasyVersion: 1.300.1
speakeasyVersion: 1.308.1
sources:
my-source:
sourceNamespace: my-source
sourceRevisionDigest: sha256:a621cbff6995a7d971a973cc7abe784ebf6f6cd5da0c305c06cc1759674cf95a
sourceBlobDigest: sha256:c4508c75038ffde557290925e80d31c169551a1f1ef948833ff7779d63c6881a
sourceRevisionDigest: sha256:2afe2b4cc03c9cec18d5b1b183a58d9d215c4741446a4deac25700bdb98a7aeb
sourceBlobDigest: sha256:5f8888fc7a7d4dd77922a6607261d2b76bb51c2aeda36e98a33d4c3cbdf40f5e
tags:
- latest
- main
targets:
unstructured-python:
source: my-source
sourceNamespace: my-source
sourceRevisionDigest: sha256:a621cbff6995a7d971a973cc7abe784ebf6f6cd5da0c305c06cc1759674cf95a
sourceBlobDigest: sha256:c4508c75038ffde557290925e80d31c169551a1f1ef948833ff7779d63c6881a
sourceRevisionDigest: sha256:2afe2b4cc03c9cec18d5b1b183a58d9d215c4741446a4deac25700bdb98a7aeb
sourceBlobDigest: sha256:5f8888fc7a7d4dd77922a6607261d2b76bb51c2aeda36e98a33d4c3cbdf40f5e
outLocation: /github/workspace/repo
workflow:
workflowVersion: 1.0.0
Expand Down
12 changes: 11 additions & 1 deletion RELEASES.md
Original file line number Diff line number Diff line change
Expand Up @@ -514,4 +514,14 @@ Based on:
### Generated
- [python v0.23.3] .
### Releases
- [PyPI v0.23.3] https://pypi.org/project/unstructured-client/0.23.3 - .
- [PyPI v0.23.3] https://pypi.org/project/unstructured-client/0.23.3 - .

## 2024-06-15 00:20:16
### Changes
Based on:
- OpenAPI Doc
- Speakeasy CLI 1.308.1 (2.342.6) https://github.com/speakeasy-api/speakeasy
### Generated
- [python v0.23.4] .
### Releases
- [PyPI v0.23.4] https://pypi.org/project/unstructured-client/0.23.4 - .
15 changes: 11 additions & 4 deletions _test_unstructured_client/integration/test_integration_freemium.py
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import asyncio
import json
import os
from pathlib import Path

import pytest
from unstructured_client import UnstructuredClient
from unstructured_client.models import shared
from unstructured_client.models.errors.sdkerror import SDKError
from unstructured_client.models.errors import SDKError, ServerError, HTTPValidationError
from unstructured_client.utils.retries import BackoffStrategy, RetryConfig


Expand Down Expand Up @@ -52,14 +53,20 @@ def event_loop():


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

error_code, sdk_raises = error

response = requests_http.Response()
response.status_code = error_code
response.headers = {'Content-Type': 'application/json'}
json_data = {"detail": "An error occurred"}
response._content = bytes(json.dumps(json_data), 'utf-8')

monkeypatch.setattr(requests_http.Session, "send", lambda *args, **kwargs: response)
monkeypatch.setattr(httpx.AsyncClient, "send", lambda *args, **kwargs: response)

Expand All @@ -82,5 +89,5 @@ def test_partition_handling_server_error(error_code, split_pdf, monkeypatch, doc
split_pdf_page=split_pdf,
)

with pytest.raises(SDKError, match=f"API error occurred: Status {error_code}"):
with pytest.raises(sdk_raises):
response = client.general.partition(req)
17 changes: 17 additions & 0 deletions docs/models/errors/detail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Detail


## Supported Types

###

```python
detail: List[shared.ValidationError] = /* values here */
```

###

```python
detail: str = /* values here */
```

6 changes: 3 additions & 3 deletions docs/models/errors/httpvalidationerror.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@

## Fields

| Field | Type | Required | Description |
| ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- | ---------------------------------------------------------------------- |
| `detail` | List[[shared.ValidationError](../../models/shared/validationerror.md)] | :heavy_minus_sign: | N/A |
| Field | Type | Required | Description |
| -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- | -------------------------------------------------------- |
| `detail` | [Optional[errors.Detail]](../../models/errors/detail.md) | :heavy_minus_sign: | N/A |
8 changes: 8 additions & 0 deletions docs/models/errors/servererror.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
# ServerError


## Fields

| Field | Type | Required | Description |
| ------------------ | ------------------ | ------------------ | ------------------ |
| `detail` | *Optional[str]* | :heavy_minus_sign: | N/A |
Loading

0 comments on commit ee2de79

Please sign in to comment.