Skip to content

Fixing some retriever bugs and adding more test coverage - #539

Merged
Aayush Kataria (aayush3011) merged 4 commits into
langchain-ai:mainfrom
aayush3011:users/akataria/cosmosFixes
Apr 26, 2026
Merged

Fixing some retriever bugs and adding more test coverage#539
Aayush Kataria (aayush3011) merged 4 commits into
langchain-ai:mainfrom
aayush3011:users/akataria/cosmosFixes

Conversation

@aayush3011

Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR addresses retriever behavior and checkpoint listing/pending-write retrieval in the Azure CosmosDB LangChain/LangGraph integrations, and adds unit/integration coverage to prevent regressions.

Changes:

  • Added retriever-focused unit tests (including async ainvoke) and an async integration test for retriever usage.
  • Updated LangGraph checkpoint store (sync + async) to push before, ordering, and (in some cases) TOP limiting into Cosmos SQL queries instead of sorting/filtering purely in Python.
  • Added _aget_relevant_documents implementation for the sync vectorstore retriever.

Reviewed changes

Copilot reviewed 6 out of 6 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
libs/azure-cosmosdb/tests/unit_tests/test_vectorstore.py Adds unit tests covering retriever invoke/ainvoke and search type validation.
libs/azure-cosmosdb/tests/unit_tests/test_langgraph_checkpoint_keys.py Adds unit tests asserting query construction details (ORDER BY/TOP/before) for checkpoint listing.
libs/azure-cosmosdb/tests/integration_tests/aio/test_vectorstore.py Adds async integration coverage for retriever ainvoke.
libs/azure-cosmosdb/src/langchain_azure_cosmosdb/aio/_langgraph_checkpoint_store.py Pushes list ordering/before/limit into Cosmos queries; changes pending writes ordering approach.
libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_langgraph_checkpoint_store.py Same as async version for sync saver; changes pending writes ordering approach.
libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_vectorstore.py Adds _aget_relevant_documents to the sync retriever and imports async callback manager type.

Comment thread libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_vectorstore.py Outdated
Comment thread libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_langgraph_checkpoint_store.py Outdated
Comment thread libs/azure-cosmosdb/tests/unit_tests/test_langgraph_checkpoint_keys.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 3 comments.

Comment thread libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_vectorstore.py

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.

Comment thread libs/azure-cosmosdb/tests/unit_tests/test_vectorstore.py
Comment thread libs/azure-cosmosdb/tests/unit_tests/test_vectorstore.py
Comment thread libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_langgraph_checkpoint_store.py Outdated
Comment thread libs/azure-cosmosdb/src/langchain_azure_cosmosdb/_langgraph_checkpoint_store.py Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.

@aayush3011
Aayush Kataria (aayush3011) marked this pull request as ready for review April 26, 2026 21:32
@aayush3011
Aayush Kataria (aayush3011) merged commit cea67f1 into langchain-ai:main Apr 26, 2026
12 checks passed
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.

2 participants