-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regenerate OpenAPI core #203
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
0e19a3b
regenerate OpenAPI core, rename vectorOperations patterns to dataPlan…
austin-denoble 5e04ab4
clean up query integration test
austin-denoble d605658
fix assertions
austin-denoble 90621fb
delete list file
austin-denoble 31d2f68
rename VoaProvider to DataProvider in unit tests
austin-denoble 5319d77
rename vectorOperationsProvider unit test file
austin-denoble File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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 |
---|---|---|
|
@@ -3,13 +3,13 @@ import { setupDeleteSuccess } from './deleteOne.test'; | |
|
||
describe('deleteAll', () => { | ||
test('calls the openapi delete endpoint, passing deleteAll with target namespace', async () => { | ||
const { VoaProvider, VOA } = setupDeleteSuccess(undefined); | ||
const { DataProvider, DPA } = setupDeleteSuccess(undefined); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed these across tests to keep things consistent with the new |
||
|
||
const deleteAllFn = deleteAll(VoaProvider, 'namespace'); | ||
const deleteAllFn = deleteAll(DataProvider, 'namespace'); | ||
const returned = await deleteAllFn(); | ||
|
||
expect(returned).toBe(void 0); | ||
expect(VOA._delete).toHaveBeenCalledWith({ | ||
expect(DPA._delete).toHaveBeenCalledWith({ | ||
deleteRequest: { deleteAll: true, namespace: 'namespace' }, | ||
}); | ||
}); | ||
|
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
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ import type { PineconeConfiguration } from './types'; | |
import { | ||
Configuration, | ||
ConfigurationParameters, | ||
VectorOperationsApi, | ||
DataPlaneApi, | ||
} from '../pinecone-generated-ts-fetch'; | ||
import { | ||
queryParamsStringify, | ||
|
@@ -13,11 +13,11 @@ import { | |
import { IndexHostSingleton } from './indexHostSingleton'; | ||
import { middleware } from '../utils/middleware'; | ||
|
||
export class VectorOperationsProvider { | ||
export class DataOperationsProvider { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Renamed this class and file to |
||
private config: PineconeConfiguration; | ||
private indexName: string; | ||
private indexHostUrl?: string; | ||
private vectorOperations?: VectorOperationsApi; | ||
private dataOperations?: DataPlaneApi; | ||
|
||
constructor( | ||
config: PineconeConfiguration, | ||
|
@@ -30,27 +30,27 @@ export class VectorOperationsProvider { | |
} | ||
|
||
async provide() { | ||
if (this.vectorOperations) { | ||
return this.vectorOperations; | ||
if (this.dataOperations) { | ||
return this.dataOperations; | ||
} | ||
|
||
// If an indexHostUrl has been manually passed we use that, | ||
// otherwise we rely on resolving the host from the IndexHostSingleton | ||
if (this.indexHostUrl) { | ||
this.vectorOperations = this.buildVectorOperationsConfig(); | ||
this.dataOperations = this.buildDataOperationsConfig(); | ||
} else { | ||
this.indexHostUrl = await IndexHostSingleton.getHostUrl( | ||
this.config, | ||
this.indexName | ||
); | ||
|
||
this.vectorOperations = this.buildVectorOperationsConfig(); | ||
this.dataOperations = this.buildDataOperationsConfig(); | ||
} | ||
|
||
return this.vectorOperations; | ||
return this.dataOperations; | ||
} | ||
|
||
buildVectorOperationsConfig() { | ||
buildDataOperationsConfig() { | ||
const indexConfigurationParameters: ConfigurationParameters = { | ||
basePath: this.indexHostUrl, | ||
apiKey: this.config.apiKey, | ||
|
@@ -63,8 +63,8 @@ export class VectorOperationsProvider { | |
}; | ||
|
||
const indexConfiguration = new Configuration(indexConfigurationParameters); | ||
const vectorOperations = new VectorOperationsApi(indexConfiguration); | ||
const dataOperations = new DataPlaneApi(indexConfiguration); | ||
|
||
return vectorOperations; | ||
return dataOperations; | ||
} | ||
} |
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See
dataOperationsProvider
file below, renamed to align with the new API class.