Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
The purpose of this PR is to introduce a class,
AsyncioIndex
that provides an async version of the functionality found in theIndex
client. This includes standard index data plane operations such asupsert
,query
, etc as well as bulk import operations (start_import
,list_imports
, etc).Solution
This is a very complex diff with many moving parts.
aiohttp
, an asyncio-compatible http client.pytest-asyncio
to support async testingpinecone/openapi_support
to introduce asyncio-variants of existing classes:AsyncioApiClient
,AsyncioEndpoint
, andAiohttpRestClient
. I don't love the way any of these are currently laid out, but for simplicity sake I decided to hew close to the existing organization since this was already going to be a complex change.AsyncioVectorOperationsApi
) objects and reference the objects named above.AsyncioIndex
that uses these asyncio variant objects. Since the majority of the logic (validation, etc) inside each data plane method ofIndex
was previously extracted intoIndexRequestFactory
, the amount of actual new code needed inside this class was minimal async from signature changes to useasync
/await
.Also:
ddtrace
dev dependency for logging test info in datadog. This was giving me a lot of annoying errors when running tests locally. I will troubleshoot and bring it back in later.jinja
andvirtualenv
versions in our poetry.lock file to resolve dependabot alertsUsage
In a standalone script, you might do something like this:
Type of Change
Test Plan
Describe specific steps for validating this change.