Fix cosmosdb vectorstore bug#14182
Open
westey-m wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the Azure Cosmos DB (NoSQL) vector store connector to build SQL filters using bound parameters for string constants, preventing SQL injection and fixing failures with apostrophes/backslash-escaped strings; adds regression coverage to validate the behavior.
Changes:
- Parameterize Cosmos NoSQL filter string literals (emit
c.field = @filter_pNplusparameters) and renumber parameter names across multiple filters in_inner_search. - Update and expand unit tests to assert parameter binding (including concurrency isolation and
_inner_searchquery assertions). - Add an integration regression test covering equality filters with apostrophes and injection-shaped payloads.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| python/semantic_kernel/connectors/azure_cosmos_db.py | Parameterizes filter string constants and renumbers filter parameters when composing multiple filters in Cosmos NoSQL queries. |
| python/tests/unit/connectors/memory/azure_cosmos_db/test_azure_cosmos_db_no_sql_collection.py | Updates unit tests for parameterized filters; adds concurrency and _inner_search parameterization coverage. |
| python/tests/integration/memory/azure_cosmos_db/test_azure_cosmos_db_no_sql.py | Adds an end-to-end regression test ensuring filtered searches behave correctly for apostrophes and injection payloads. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Contributor
Python Test Coverage Report •
Python Unit Test Overview
|
||||||||||||||||||||||||||||||
eavanvalkenburg
approved these changes
Jul 23, 2026
giles17
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation and Context
Description
Contribution Checklist