Fix full text policy test assertions to accommodate backend V2 read behavior#45688
Open
aayush3011 wants to merge 4 commits intoAzure:mainfrom
Open
Fix full text policy test assertions to accommodate backend V2 read behavior#45688aayush3011 wants to merge 4 commits intoAzure:mainfrom
aayush3011 wants to merge 4 commits intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates full text policy test assertions in the Cosmos SDK to accommodate a backend V2 change in how full text policies are returned on reads. Instead of comparing the entire policy object (which now may contain additional fields like defaultSpec), tests now assert on individual known fields (defaultLanguage, fullTextPaths).
Changes:
- Updated assertions in sync and async full text policy tests to compare individual fields rather than entire policy objects.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
sdk/cosmos/azure-cosmos/tests/test_full_text_policy.py |
Updated sync test assertions to check defaultLanguage and fullTextPaths individually |
sdk/cosmos/azure-cosmos/tests/test_full_text_policy_async.py |
Updated async test assertions to check defaultLanguage and fullTextPaths individually |
You can also share your feedback on Copilot code review. Take the survey.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Member
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
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.
Description
The full text policy tests were failing due to a backend change in how the full text policy is returned on reads. The backend now implements V2 of the full text policy while still accepting V1 for backward compatibility. However, the policy returned in the read response is no longer identical to what was sent during container creation.
The backend's updated read behavior now populates both defaultLanguage and defaultSpec fields:
Because the response may contain additional fields not present in the original request, tests now assert on individual fields (defaultLanguage, fullTextPaths) rather than comparing the entire policy object.
Full support for the V2 full text policy with defaultSpec will follow in a separate PR, as the backend is still finalizing additional V2 functionality.
All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines