mirror of
https://github.com/langchain-ai/langchain-pinecone.git
synced 2026-07-19 22:03:33 -04:00
Regression: Retriever passes namespace=None causing default namespace to be ignored in similarity_search_by_vector_with_score (v0.2.11) #27
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @hieptran1401 on GitHub (Oct 7, 2025).
Originally assigned to: @theanupllm on GitHub.
Package/version
Description
After upgrading to v0.2.11, the retriever path passes
namespace=NoneintoPineconeVectorStore.similarity_search_by_vector_with_score. The implementation readsnamespacevia kwargs:Because
kwargscontainsnamespace=None, the fallback toself._namespaceis skipped. In v0.2.10,namespacewas an explicit parameter with a properNonefallback:This regression causes queries that should use the default namespace to instead query the empty namespace.
Steps to reproduce
PineconeVectorStorewith a default namespace:similarity_search_by_vector_with_scoreand observe:Expected behavior
namespaceis not provided or isNone, it should fall back toself._namespace.Actual behavior
kwargsincludesnamespace=None, which overrides the fallback and results in querying the empty namespace instead ofself._namespace.Example logs (with clearer order)
Case 1 (no namespace passed to retriever):
Case 2 (explicit namespace passed to retriever):
Regression details
if namespace is None: namespace = self._namespace.kwargs.get(...)whereNoneprevents fallback.Possible fixes
namespacekey in kwargs when the value isNone.Minimal reproducible example