Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: pinecone-io/pinecone-python-client
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v5.4.1
Choose a base ref
...
head repository: pinecone-io/pinecone-python-client
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v5.4.2
Choose a head ref
  • 2 commits
  • 7 files changed
  • 2 contributors

Commits on Dec 6, 2024

  1. [Bug] query_namespaces can handle single result (#421)

    ## Problem
    
    In order to merge results across multiple queries, the SDK must know
    which similarity metric an index is using. For dotproduct and cosine
    indexes, a larger score is better while for euclidean a smaller score is
    better. Unfortunately the data plane API does not currently expose the
    metric type and a separate call to the control plane to find out seems
    undesirable from a resiliency and performance perspective.
    
    As a workaround, in the initial implementation of `query_namespaces` the
    SDK would infer the similarity metric needed to merge results by seeing
    whether the scores of query results were ascending or descending. This
    worked well, but imposes an implicit limitation that there must be at
    least 2 results returned.
    
    We initially believed this would not be a problem but have since learned
    that applications using filtering can sometimes filter out all or most
    results. So an approach that has the user explicitly telling the SDK
    what similarity metric is being used is preferred to handle these edge
    cases with 1 or 0 results.
    
    ## Solution
    
    - Add a required kwarg to `query_namespaces` to specify the index
    similarity metric.
    - Modify `QueryResultsAggregator` to use this similarity metric, and
    strip out code that was involved in inferring whether results were
    ascending or descending.
    - Adjust integration tests to pass new metric kwarg. Except for adding
    the new kwarg, query_namespaces integration tests did not need to change
    which indicates the underlying behavior is still working as before.
    
    ## Type of Change
    
    - [x] Bug fix (non-breaking change which fixes an issue)
    jhamon authored Dec 6, 2024
    Configuration menu
    Copy the full SHA
    5453aab View commit details
    Browse the repository at this point in the history

Commits on Dec 9, 2024

  1. [skip ci] Bump version to v5.4.2

    Pinecone CI committed Dec 9, 2024
    Configuration menu
    Copy the full SHA
    a023f60 View commit details
    Browse the repository at this point in the history
Loading