Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
Merge branch 'merge_queue' of github.com:pinecone-io/context-engine i…
Browse files Browse the repository at this point in the history
…nto merge_queue
  • Loading branch information
igiloh-pinecone committed Oct 29, 2023
2 parents db5078d + 97e822f commit 2a9fbba
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/canopy/knowledge_base/knowledge_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -433,11 +433,11 @@ def _query_index(self,
if self._index is None:
raise RuntimeError(self._connection_error_msg)

metadata_filter = deepcopy(query.metadata_filter)
filter = deepcopy(query.metadata_filter)
if global_metadata_filter is not None:
if metadata_filter is None:
metadata_filter = {}
metadata_filter.update(global_metadata_filter)
if filter is None:
filter = {}
filter.update(global_metadata_filter)
top_k = query.top_k if query.top_k else self._default_top_k

query_params = deepcopy(query.query_params)
Expand All @@ -446,7 +446,7 @@ def _query_index(self,
sparse_vector=query.sparse_values,
top_k=top_k,
namespace=query.namespace,
metadata_filter=metadata_filter,
metadata_filter=filter,
include_metadata=True,
_check_return_type=_check_return_type,
**query_params)
Expand Down

0 comments on commit 2a9fbba

Please sign in to comment.