Commit 643ed88
authored
chore: revert custom changes to autogenerated code (#181)
# The issue
The v2 python client has some minor breaking changes for our users, both
related to keyword parameters:
* The PartitionRequest class is now a pydantic model which does not
support positional arguments in the constructor. Therefore we always
have to name the `partition_parameters` field.
```
req = operations.PartitionRequest(
shared.PartitionParameters(
....
....
)
)
```
becomes
```
req = operations.PartitionRequest(
partition_parameters=shared.PartitionParameters(
....
....
)
)
```
* Likewise, the function signature for `general.partition` no longer
allows for positional args.
Instead of
```
response = client.general.partition(req)
```
we have to do
```
response = client.general.partition(request=req)
```
# The first approach
These are minimal changes, but they will disrupt a number of users who
have copied our sample snippets in the past. My workaround for this was
to manually patch the autogenerated code to bring back positional
params. However, this will be messy in the long term, as we now have to
apply our changes after every regenerate. Instead, let's embrace the
version bump to 0.16.0 and just document the breaking change.
Update: The python snippet in the serverless dashboard uses keyword
args, so users who copied this out are unaffected.
# Changes
- Revert my manual edits to:
- Allow `request` as a positional arg in `general.partition`
(`general.py`)
- Add a constructor to `PartitionRequest` so we don't have to use a
keyword arg
- Remove the patch file containing these changes
- Update some makefile commands to reuse in other repos1 parent 5954e72 commit 643ed88
File tree
6 files changed
+12
-42
lines changed- _test_unstructured_client
- integration
- unit
- src/unstructured_client
- models/operations
6 files changed
+12
-42
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
17 | 22 | | |
18 | 23 | | |
19 | 24 | | |
| |||
48 | 53 | | |
49 | 54 | | |
50 | 55 | | |
| 56 | + | |
51 | 57 | | |
52 | 58 | | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
56 | 62 | | |
57 | 63 | | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | | - | |
61 | 67 | | |
62 | 68 | | |
63 | 69 | | |
64 | 70 | | |
65 | | - | |
66 | | - | |
67 | | - | |
68 | | - | |
69 | 71 | | |
70 | 72 | | |
71 | 73 | | |
| |||
This file was deleted.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
356 | 356 | | |
357 | 357 | | |
358 | 358 | | |
359 | | - | |
| 359 | + | |
360 | 360 | | |
361 | 361 | | |
362 | 362 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
126 | 126 | | |
127 | 127 | | |
128 | 128 | | |
129 | | - | |
| 129 | + | |
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
17 | | - | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
| 119 | + | |
119 | 120 | | |
120 | 121 | | |
121 | 122 | | |
122 | | - | |
123 | 123 | | |
124 | 124 | | |
125 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | 28 | | |
32 | 29 | | |
33 | 30 | | |
| |||
0 commit comments