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

Add sparseVector to QueryByVectorValues type #236

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

austin-denoble
Copy link
Contributor

Problem

sparseVector?: RecordSparseValues was left out of the QueryByVectorValues type. While the API supports sending sparseVector with query requests, if you attempt to compile the client with TypeScript you'll get a build error.

Issue: #218

Solution

  • Update the QueryByVectorValues type to include sparseVector?: RecordSparseValues. This should allow users to pass a sparseVector along with their query operation if needed.
  • Update query docstring + integration tests.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • 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

Verify CI integration tests pass. I added sparseVector to several of our happy-path query tests.

Testing this via the repl wasn't sufficient as you could pass the value directly, and you don't get TS build errors.

To properly test you'll need a TypeScript project that uses the Pinecone SDK, and queries with a sparseVector in the request object. tsc will fail if using the previous client.

…er (#234)

## Problem
We want to allow `:` in `sourceTags` that are applied to user-agent
headers on network requests.

## Solution

- Update `normalizeSourceTag` function to allow `:` as an accepted
character.
- Add new unit test permutation to validate functionality.

## 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
Test locally using the TyepScript repl with `PINECONE_DEBUG` and
`PINECONE_DEBUG_CURL` to monitor network traffic:
![Screenshot 2024-06-26 at 7 17
05 PM](https://github.com/pinecone-io/pinecone-ts-client/assets/119623786/e8014ff2-c623-4522-8361-7ea602b27e4b)


---
- To see the specific tasks where the Asana app for GitHub is being
used, see below:
  - https://app.asana.com/0/0/1207476368919278
@austin-denoble austin-denoble requested review from jhamon and mcpaddy July 3, 2024 17:29
@@ -173,11 +173,6 @@ describe('IndexHostSingleton', () => {
expect(mockDescribeIndex).toHaveBeenNthCalledWith(1, 'index-1');
expect(mockDescribeIndex).toHaveBeenNthCalledWith(2, 'index-2');

console.log(
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

whoops, must have left this in previously 😅

Copy link

@mcpaddy mcpaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nice.

@austin-denoble austin-denoble changed the base branch from main to 2024-07-rc July 10, 2024 16:05
@austin-denoble austin-denoble merged commit efacb05 into 2024-07-rc Jul 10, 2024
33 checks passed
@austin-denoble austin-denoble deleted the adenoble/query-by-sparse-vector branch July 10, 2024 16:05
austin-denoble added a commit that referenced this pull request Jul 15, 2024
## Problem
`sparseVector?: RecordSparseValues` was left out of the
`QueryByVectorValues` type. While the API supports sending
`sparseVector` with query requests, if you attempt to compile the client
with TypeScript you'll get a build error.

Issue: #218

## Solution

- Update the `QueryByVectorValues` type to include `sparseVector?:
RecordSparseValues`. This should allow users to pass a `sparseVector`
along with their `query` operation if needed.
- Update `query` docstring + integration tests.

## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] 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
Verify CI integration tests pass. I added `sparseVector` to several of
our happy-path `query` tests.

Testing this via the repl wasn't sufficient as you could pass the value
directly, and you don't get TS build errors.

To properly test you'll need a TypeScript project that uses the Pinecone
SDK, and queries with a `sparseVector` in the request object. `tsc` will
fail if using the previous client.
austin-denoble added a commit that referenced this pull request Jul 19, 2024
## Problem
`sparseVector?: RecordSparseValues` was left out of the
`QueryByVectorValues` type. While the API supports sending
`sparseVector` with query requests, if you attempt to compile the client
with TypeScript you'll get a build error.

Issue: #218

## Solution

- Update the `QueryByVectorValues` type to include `sparseVector?:
RecordSparseValues`. This should allow users to pass a `sparseVector`
along with their `query` operation if needed.
- Update `query` docstring + integration tests.

## Type of Change
- [X] Bug fix (non-breaking change which fixes an issue)
- [ ] 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
Verify CI integration tests pass. I added `sparseVector` to several of
our happy-path `query` tests.

Testing this via the repl wasn't sufficient as you could pass the value
directly, and you don't get TS build errors.

To properly test you'll need a TypeScript project that uses the Pinecone
SDK, and queries with a `sparseVector` in the request object. `tsc` will
fail if using the previous client.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] Cannot preform hybrid search, query by vector does not take sparse vector value
3 participants