Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
jhamon committed Oct 22, 2024
1 parent e087278 commit 247a329
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions pinecone/grpc/query_results_aggregator.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,15 +81,8 @@ def __repr__(self):
)


class QueryResultsAggregationEmptyResultsError(Exception):
def __init__(self, namespace: str):
super().__init__(
f"Query results for namespace '{namespace}' were empty. Check that you have upserted vectors into this namespace (see describe_index_stats) and that the namespace name is spelled correctly."
)


class QueryResultsAggregregatorNotEnoughResultsError(Exception):
def __init__(self, num_results: int):
def __init__(self):
super().__init__(
"Cannot interpret results without at least two matches. In order to aggregate results from multiple queries, top_k must be greater than 1 in order to correctly infer the similarity metric from scores."
)
Expand Down Expand Up @@ -164,7 +157,7 @@ def add_results(self, results: Dict[str, Any]):
# This condition should match the second time we add results containing
# only one match. We need at least two matches in a single response in order
# to infer the similarity metric
raise QueryResultsAggregregatorNotEnoughResultsError(len(matches))
raise QueryResultsAggregregatorNotEnoughResultsError()
self.is_dotproduct = self._is_dotproduct_index(matches)

if self.is_dotproduct:
Expand Down

0 comments on commit 247a329

Please sign in to comment.