Commit ff7b81d
authored
Add bulk import (#386)
## Problem
Implement the following new methods:
- `start_import`
- `describe_import`
- `list_imports`
- `cancel_import`
## Solution
#### Code generation changes
Since these features are in prerelease, they only exist in the spec for
the upcoming 2024-10 API version. This required me to make modifications
to the codegen script that is now run as:
```
./codegen/build-oas.sh 2024-07 false && ./codegen/build-oas.sh 2024-10 true
```
The second boolean argument is used to tell the codegen script whether
the generated code should be stored in a new `pinecone/core_ea`
subpackage. In the future we should probably do more to hide this
complexity from the developer, but for now it is good enough.
#### Code organization
For the bespoke bits of the implementation that wrap the generated code,
I have put them into a new class, `ImportFeatureMixin`, that the `Index`
class inherits from. These functions could have all been implemented
directly in the `Index` class, but I thought it a bit tidier to
segregate these into a separate spot than just dump everything into one
giant file.
#### Overridden repr representation on generated objects
The default print output in the generated classes comes from pprint and
it looks quite poor for large objects. So I installed overrides that
dump the objects into a formatted json style instead. I had previously
done something similar for describe_index, etc, methods, so for this PR
it was just a matter of cleaning up that logic a bit and moving it
somewhere it could be reused.
So far, I haven't tweaked the generated classes to do this approach
across the board because it doesn't work well for long arrays of vector
values.
## Type of Change
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] This change requires a documentation update
- [ ] Infrastructure change (CI configs, etc)
- [ ] Non-code change (docs, etc)
- [ ] None of the above: (explain here)
## Test Plan
Manual testing with a dev release is in this [demo
notebook](https://colab.research.google.com/drive/1W3OhMDG1yW2rdwx-ZulYH847m9R_IUuK#scrollTo=gGvVbfkYNz61
)1 parent 4e9a40c commit ff7b81d
File tree
131 files changed
+19549
-202
lines changed- .github/workflows
- codegen
- pinecone
- config
- control
- core_ea/openapi
- db_control
- apis
- api
- models
- model
- db_data
- apis
- api
- models
- model
- core/openapi
- control/model
- data
- api
- model
- data
- features
- utils
- tests/unit
- data
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
131 files changed
+19549
-202
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
| 52 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
Submodule apis updated from 062b114 to 3b7369b
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
7 | 20 | | |
8 | | - | |
9 | 21 | | |
10 | 22 | | |
11 | 23 | | |
| |||
58 | 70 | | |
59 | 71 | | |
60 | 72 | | |
61 | | - | |
62 | | - | |
| 73 | + | |
63 | 74 | | |
64 | 75 | | |
65 | | - | |
66 | 76 | | |
67 | 77 | | |
68 | 78 | | |
| |||
73 | 83 | | |
74 | 84 | | |
75 | 85 | | |
76 | | - | |
| 86 | + | |
77 | 87 | | |
78 | 88 | | |
79 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
80 | 96 | | |
81 | 97 | | |
82 | | - | |
| 98 | + | |
| 99 | + | |
83 | 100 | | |
84 | 101 | | |
85 | 102 | | |
| |||
118 | 135 | | |
119 | 136 | | |
120 | 137 | | |
121 | | - | |
| 138 | + | |
122 | 139 | | |
123 | 140 | | |
124 | | - | |
| 141 | + | |
125 | 142 | | |
126 | 143 | | |
127 | | - | |
| 144 | + | |
128 | 145 | | |
129 | 146 | | |
130 | 147 | | |
| |||
This file was deleted.
This file was deleted.
Submodule python-oas-templates updated from 7e6d01b to c48d935
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
| 27 | + | |
| 28 | + | |
27 | 29 | | |
28 | 30 | | |
29 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | | - | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
| 16 | + | |
0 commit comments