Skip to content
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

[spruce] Remove v0 code paths and references #181

Merged
merged 3 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"es2021": true,
"node": true
},
"ignorePatterns": ["dist", "src/pinecone-generated-ts-fetch", "src/v0"],
"ignorePatterns": ["dist", "src/pinecone-generated-ts-fetch"],
"extends": [
"eslint:recommended",
"plugin:@typescript-eslint/recommended",
Expand Down
3 changes: 1 addition & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
dist
node_modules
src/pinecone-generated-ts-fetch
src/v0
src/pinecone-generated-ts-fetch
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -629,7 +629,3 @@ If you do not specify a namespace, the records in the default namespace `''` wil
If you are ready to take a JavaScript application to production where raw performance is the overriding concern, you can set the environment variable `PINECONE_DISABLE_RUNTIME_VALIDATIONS="true"` to disable runtime argument validation in the Pinecone client. Runtime validations are used to provide feedback when incorrect method options are provided, for example if you attempt to create an index without specifying a required dimension property.

These runtime validations are most helpful for users who are not developing with Typescript or who are experimenting in a REPL or notebook-type setting. But once you've tested an application and have gained confidence things are working as expected, you can disable these checks to gain a small improvement in performance. This will have the most impact if your workload is upserting very large amounts of data.

## Legacy exports

For information about the legacy `PineconeClient` export, see the [old README](https://github.com/pinecone-io/pinecone-ts-client/blob/main/README.v0.md).
276 changes: 0 additions & 276 deletions README.v0.md

This file was deleted.

1 change: 0 additions & 1 deletion jest.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ module.exports = {
collectCoverageFrom: [
'<rootDir>/src/**/*.ts',
'!**/src/pinecone-generated-ts-fetch/**',
'!**/src/v0/**',
'!**/node_modules/**',
'!**/vendor/**',
],
Expand Down
2 changes: 1 addition & 1 deletion src/control/indexOperationsBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export const indexOperationsBuilder = (
apiKey,
queryParamsStringify,
headers: {
'User-Agent': buildUserAgent(false),
'User-Agent': buildUserAgent(),
...headers,
},
fetchApi: getFetch(config),
Expand Down
2 changes: 1 addition & 1 deletion src/data/vectorOperationsProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export class VectorOperationsProvider {
apiKey: this.config.apiKey,
queryParamsStringify,
headers: {
'User-Agent': buildUserAgent(false),
'User-Agent': buildUserAgent(),
},
fetchApi: getFetch(this.config),
middleware,
Expand Down
16 changes: 0 additions & 16 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,19 +52,3 @@ export type {
IndexList,
IndexModel,
} from './pinecone-generated-ts-fetch';

// Legacy exports for backwards compatibility
export { PineconeClient } from './v0';
export { utils } from './v0/utils';
export {
CreateCollectionRequest as CreateCollectionRequestV0,
CreateRequest,
DeleteRequest,
PatchRequest,
QueryRequest,
QueryVector,
ScoredVector,
UpdateRequest,
UpsertRequest,
Vector,
} from './v0/pinecone-generated-ts-fetch';
6 changes: 1 addition & 5 deletions src/utils/user-agent.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { isEdge } from './environment';
import * as packageInfo from '../version.json';

export const buildUserAgent = (isLegacy: boolean) => {
export const buildUserAgent = () => {
// We always want to include the package name and version
// along with the langauge name to help distinguish these
// requests from those emitted by other clients
Expand All @@ -24,9 +24,5 @@ export const buildUserAgent = (isLegacy: boolean) => {
userAgentParts.push(`node ${process.version}`);
}

// Use this flag to identify whether they are using the v0 legacy
// client export called PineconeClient
userAgentParts.push(`legacyExport=${isLegacy}`);

return userAgentParts.join('; ');
};
Loading