[PR #61] [MERGED] fix: async perf #75

Closed
opened 2026-02-16 07:16:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/langchain-ai/langchain-pinecone/pull/61
Author: @jamescalam
Created: 7/23/2025
Status: Merged
Merged: 7/23/2025
Merged by: @jamescalam

Base: mainHead: james/async-perf


📝 Commits (4)

📊 Changes

5 files changed (+264 additions, -9 deletions)

View changed files

📝 libs/pinecone/README.md (+30 -0)
📝 libs/pinecone/langchain_pinecone/vectorstores.py (+27 -6)
📝 libs/pinecone/langchain_pinecone/vectorstores_sparse.py (+2 -0)
📝 libs/pinecone/tests/integration_tests/test_embeddings.py (+33 -3)
📝 libs/pinecone/tests/unit_tests/test_vectorstores.py (+172 -0)

📄 Description

This pull request introduces several updates to enhance the functionality and testing of the Pinecone integration in the langchain_pinecone library. The changes include adding support for specifying a host parameter, improving environment variable handling, and expanding the test suite with both unit and integration tests. Below is a summary of the most important changes:

Enhancements to Pinecone Integration

  • Added a new host parameter to the PineconeVectorStore and PineconeSparseVectorStore classes, allowing users to specify a custom host for Pinecone indices. If no host is provided, it defaults to the PINECONE_HOST environment variable. (libs/pinecone/langchain_pinecone/vectorstores.py: [1] [2] [3] [4] [5]; libs/pinecone/langchain_pinecone/vectorstores_sparse.py: [6] [7]

  • Improved error handling by ensuring that either an index_name or a host must be provided during initialization. If neither is available, a ValueError is raised. (libs/pinecone/langchain_pinecone/vectorstores.py: libs/pinecone/langchain_pinecone/vectorstores.pyR236-R254)

Expanded Test Suite

  • Added integration tests for Pinecone embeddings, ensuring that required environment variables (PINECONE_API_KEY and optionally OPENAI_API_KEY) are checked before running tests. Tests are skipped if these variables are not set. (libs/pinecone/tests/integration_tests/test_embeddings.py: [1] [2] [3] [4]

  • Enhanced unit tests for PineconeVectorStore to validate host caching, host-based initialization, and behavior when both a host and an index are provided. Mocked clients (PineconeClient and PineconeAsyncioClient) were introduced to simulate Pinecone behavior. (libs/pinecone/tests/unit_tests/test_vectorstores.py: [1] [2]

Documentation Updates

  • Updated the README.md file to include instructions for running unit and integration tests, along with details on required environment variables. This improves developer onboarding and testing clarity. (libs/pinecone/README.md: libs/pinecone/README.mdR16-R45)

These changes collectively improve the flexibility, robustness, and test coverage of the Pinecone integration, making it easier for developers to configure, use, and validate the library.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/langchain-ai/langchain-pinecone/pull/61 **Author:** [@jamescalam](https://github.com/jamescalam) **Created:** 7/23/2025 **Status:** ✅ Merged **Merged:** 7/23/2025 **Merged by:** [@jamescalam](https://github.com/jamescalam) **Base:** `main` ← **Head:** `james/async-perf` --- ### 📝 Commits (4) - [`44de3d2`](https://github.com/langchain-ai/langchain-pinecone/commit/44de3d2e637e07efb1f4dc0a75f6f7eb74d5a927) Fix Pinecone Async Performance Issue with Host Configuration (#49) - [`9030690`](https://github.com/langchain-ai/langchain-pinecone/commit/903069056feaf504f17adf2adbfe356e7d9e7803) fix: rely solely on constructor - [`3eb095e`](https://github.com/langchain-ai/langchain-pinecone/commit/3eb095ed1b4eea7c5b649b9c01611fda1366a2d8) chore: lint - [`0fe5acd`](https://github.com/langchain-ai/langchain-pinecone/commit/0fe5acda277c12968db9b57ba447e37acf058467) fix: host ### 📊 Changes **5 files changed** (+264 additions, -9 deletions) <details> <summary>View changed files</summary> 📝 `libs/pinecone/README.md` (+30 -0) 📝 `libs/pinecone/langchain_pinecone/vectorstores.py` (+27 -6) 📝 `libs/pinecone/langchain_pinecone/vectorstores_sparse.py` (+2 -0) 📝 `libs/pinecone/tests/integration_tests/test_embeddings.py` (+33 -3) 📝 `libs/pinecone/tests/unit_tests/test_vectorstores.py` (+172 -0) </details> ### 📄 Description This pull request introduces several updates to enhance the functionality and testing of the Pinecone integration in the `langchain_pinecone` library. The changes include adding support for specifying a host parameter, improving environment variable handling, and expanding the test suite with both unit and integration tests. Below is a summary of the most important changes: ### Enhancements to Pinecone Integration * Added a new `host` parameter to the `PineconeVectorStore` and `PineconeSparseVectorStore` classes, allowing users to specify a custom host for Pinecone indices. If no host is provided, it defaults to the `PINECONE_HOST` environment variable. (`libs/pinecone/langchain_pinecone/vectorstores.py`: [[1]](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9R185) [[2]](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9R201) [[3]](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9R213-R215) [[4]](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9R236-R254) [[5]](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9L251-R265); `libs/pinecone/langchain_pinecone/vectorstores_sparse.py`: [[6]](diffhunk://#diff-cbe9c5185528782b017e1d64c37bdce5a95249af70f1b5219c8a16abe134c709R185) [[7]](diffhunk://#diff-cbe9c5185528782b017e1d64c37bdce5a95249af70f1b5219c8a16abe134c709R199) * Improved error handling by ensuring that either an `index_name` or a `host` must be provided during initialization. If neither is available, a `ValueError` is raised. (`libs/pinecone/langchain_pinecone/vectorstores.py`: [libs/pinecone/langchain_pinecone/vectorstores.pyR236-R254](diffhunk://#diff-7d82bf404beeafbc48f2cacade4a116fd52f5d74f704c1f7da10e9e2f6b4a7c9R236-R254)) ### Expanded Test Suite * Added integration tests for Pinecone embeddings, ensuring that required environment variables (`PINECONE_API_KEY` and optionally `OPENAI_API_KEY`) are checked before running tests. Tests are skipped if these variables are not set. (`libs/pinecone/tests/integration_tests/test_embeddings.py`: [[1]](diffhunk://#diff-76325bf8036059cbcd13cf259523b86c396095a9294bd2286bb98ca1d2197e87R1-R8) [[2]](diffhunk://#diff-76325bf8036059cbcd13cf259523b86c396095a9294bd2286bb98ca1d2197e87R29-R93) [[3]](diffhunk://#diff-76325bf8036059cbcd13cf259523b86c396095a9294bd2286bb98ca1d2197e87R102) [[4]](diffhunk://#diff-76325bf8036059cbcd13cf259523b86c396095a9294bd2286bb98ca1d2197e87L90-R120) * Enhanced unit tests for `PineconeVectorStore` to validate host caching, host-based initialization, and behavior when both a host and an index are provided. Mocked clients (`PineconeClient` and `PineconeAsyncioClient`) were introduced to simulate Pinecone behavior. (`libs/pinecone/tests/unit_tests/test_vectorstores.py`: [[1]](diffhunk://#diff-8b9e818f85ebd531b5003d03132170a23bec1bc5d8cddc18381cc2d0a0b3df38R79-R97) [[2]](diffhunk://#diff-8b9e818f85ebd531b5003d03132170a23bec1bc5d8cddc18381cc2d0a0b3df38R152-R299) ### Documentation Updates * Updated the `README.md` file to include instructions for running unit and integration tests, along with details on required environment variables. This improves developer onboarding and testing clarity. (`libs/pinecone/README.md`: [libs/pinecone/README.mdR16-R45](diffhunk://#diff-327e5e9bf655b5894f0fae206325d37c0b4802939d5e0e96ebc6874a42752458R16-R45)) These changes collectively improve the flexibility, robustness, and test coverage of the Pinecone integration, making it easier for developers to configure, use, and validate the library. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-16 07:16:11 -05:00
yindo closed this issue 2026-02-16 07:16:11 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langchain-ai/langchain-pinecone#75