-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Python: Fixes to Cosmos DB NoSQL query syntax generation. #10373
Conversation
Python Test Coverage Report •
Python Unit Test Overview
|
Hi @davidatorres, thanks for the PR! Have you installed the uv run pre-commit install -c python/.pre-commit-config.yaml Now, when you running |
Are there any further unit tests we need to exercise the new code? |
No new tests needed. Updates correct the generation of the SQL queries to ensure that they are populated and formatted correctly. |
Motivation and Context
Review information:
There were several SQL query syntax generation issue for both text_search() and vectorized_search() methods
a) In
_build_where_clauses_from_filter()
the WHERE clause creation did not quote string values and did not properly handle list[] data model attribures,b) for
_build_vector_query()
method the WHERE clause was placed after the ORDER BY clause causing query syntax errors,c) for
_build_search_text_query()
method the data_model_definition items were not being interrogated, thus addedCONTAINS()
in the WHERE clause.The ability to use Azure Cosmos DB NoSQL for
text_search()
andvectorized_search()
.Python: Bug: AzureCosmosDBNoSQLCollection text_search() and vectorized_search() produce incorrect results due to malformed query strings. #10368
Description
The errors noted in the Issue and the bug fixes noted above correct the SQL query syntax generation for the
text_search()
andvectorized_search()
methods and now produce accurate results for performing both types of queries with and without filters (aka WHERE clause).Contribution Checklist