Skip to content

Conversation

@theanupllm
Copy link
Collaborator

Summary

  • Remove hard dependency on pinecone[asyncio] for sync‑only users; require it only when async APIs are used.
  • Provide clear, actionable ImportErrors for async paths when the extra isn’t installed.

Changes

  • Async optionalization and lazy imports:
    • vectorstores: lazy‑import PineconeAsyncio; in async_index raise ImportError with guidance if missing; sync paths unchanged.
    • embeddings: lazy‑import PineconeAsyncio; async_client raises ImportError with guidance if missing.
    • rerank: lazy‑import PineconeAsyncio; _get_async_client raises ImportError; public arerank logs and returns [] when extra is missing.
  • Packaging updates (libs/pinecone/pyproject.toml):
    • Base dep now pinecone>=6,<8 (no asyncio extra by default).
    • Add optional extra: asyncio = ["pinecone[asyncio]>=6,<8"].
    • Ensure CI retains async coverage by adding pinecone[asyncio] to test and test_integration groups.
  • Tests:
    • Add tests/unit_tests/test_optional_asyncio.py verifying:
      • Sync vector store and embeddings work without asyncio extra.
      • Async vector store/embeddings raise ImportError.
      • Reranker _get_async_client() raises ImportError; arerank() returns [] and logs guidance.

Developer Notes

  • Sync usage requires no change.
  • For async usage, consumers should install one of:
    • pip install langchain-pinecone[asyncio] (package extra)
    • or ensure pinecone[asyncio] is present in their environment.

Fixes

@theanupllm theanupllm linked an issue Oct 10, 2025 that may be closed by this pull request
@theanupllm theanupllm requested a review from jamescalam October 10, 2025 05:38
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.

pinecone[asyncio] extra shouldn't be required dependency

2 participants