Skip to content

Commit

Permalink
Revert our custom patch changes
Browse files Browse the repository at this point in the history
  • Loading branch information
awalker4 committed Sep 19, 2024
1 parent 4d716d0 commit 830bee6
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 41 deletions.
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ client-generate-local:
speakeasy overlay apply -s ./openapi.json -o ./overlay_client.yaml > ./openapi_client.json
speakeasy generate sdk -s ./openapi_client.json -o ./ -l python

.PHONY: patch-custom-code
patch-custom-code:
git apply _custom_code.patch

.PHONY: publish
publish:
./scripts/publish.sh
Expand Down
29 changes: 0 additions & 29 deletions _custom_code.patch

This file was deleted.

2 changes: 1 addition & 1 deletion _test_unstructured_client/integration/test_decorators.py
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ async def mock_send(_, request: httpx.Request, **kwargs):
)

req = operations.PartitionRequest(
shared.PartitionParameters(
partition_parameters=shared.PartitionParameters(
files=files,
split_pdf_page=True,
split_pdf_allow_failed=False,
Expand Down
4 changes: 2 additions & 2 deletions _test_unstructured_client/unit/test_custom_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,11 @@ def mock_post(request):
files = shared.Files(content=f.read(), file_name=filename)

req = operations.PartitionRequest(
shared.PartitionParameters(files=files)
partition_parameters=shared.PartitionParameters(files=files)
)

with pytest.raises(Exception, match=f"Status {status_code}"):
session.general.partition(req, retries=retries)
session.general.partition(request=req, retries=retries)

if expect_retry:
assert number_of_requests[0] > 1
Expand Down
4 changes: 2 additions & 2 deletions src/unstructured_client/general.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@
class General(BaseSDK):
def partition(
self,
*,
request: Union[
operations.PartitionRequest, operations.PartitionRequestTypedDict
],
*,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
Expand Down Expand Up @@ -116,10 +116,10 @@ def partition(

async def partition_async(
self,
*,
request: Union[
operations.PartitionRequest, operations.PartitionRequestTypedDict
],
*,
retries: OptionalNullable[utils.RetryConfig] = UNSET,
server_url: Optional[str] = None,
timeout_ms: Optional[int] = None,
Expand Down
3 changes: 0 additions & 3 deletions src/unstructured_client/models/operations/partition.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@ class PartitionRequestTypedDict(TypedDict):


class PartitionRequest(BaseModel):
def __init__(self, partition_parameters, **kwargs):
BaseModel.__init__(self, partition_parameters=partition_parameters, **kwargs)

partition_parameters: Annotated[
shared_partition_parameters.PartitionParameters,
FieldMetadata(request=RequestMetadata(media_type="multipart/form-data")),
Expand Down

0 comments on commit 830bee6

Please sign in to comment.