-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
## 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 )
- Loading branch information
Showing
131 changed files
with
19,549 additions
and
202 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -49,3 +49,4 @@ jobs: | |
secrets: | ||
PYPI_USERNAME: __token__ | ||
PYPI_PASSWORD: ${{ secrets.PROD_PYPI_PUBLISH_TOKEN }} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule apis
updated
from 062b11 to 3b7369
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Submodule python-oas-templates
updated
from 7e6d01 to c48d93
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,8 +76,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,8 +69,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -70,8 +70,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,8 +89,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -66,8 +66,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,8 +72,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -91,8 +91,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -74,8 +74,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76,8 +76,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -82,8 +82,6 @@ def additional_properties_type(): | |
lazy_import() | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -65,8 +65,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -71,8 +71,6 @@ def additional_properties_type(): | |
""" | ||
return ( | ||
bool, | ||
date, | ||
datetime, | ||
dict, | ||
float, | ||
int, | ||
|
Oops, something went wrong.