[Cosmos] reformat availability_strategy use#45141
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Addresses missing API-view/documentation details for Cosmos cross-region hedging and hides an internal user-agent policy implementation.
Changes:
- Expanded
availability_strategydocstrings to describe cross-region hedging configuration. - Moved
CosmosUserAgentPolicyinto a new internal module (_user_agent_policy.py) and updated sync/async imports accordingly. - Updated cross-region hedging README content (plus changelog date adjustment).
Reviewed changes
Copilot reviewed 8 out of 9 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/fix_docstrings.py | Adds a one-off script intended to rewrite docstrings in container modules. |
| sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py | Updates CosmosClient constructor docstring for availability_strategy. |
| sdk/cosmos/azure-cosmos/azure/cosmos/container.py | Updates multiple container method docstrings for availability_strategy. |
| sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py | Switches async connection to import the internal _user_agent_policy. |
| sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py | Updates multiple async container method docstrings for availability_strategy. |
| sdk/cosmos/azure-cosmos/azure/cosmos/_user_agent_policy.py | Introduces internal CosmosUserAgentPolicy implementation. |
| sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py | Switches sync connection to import the internal _user_agent_policy. |
| sdk/cosmos/azure-cosmos/README.md | Updates cross-region hedging docs and adds a “Best Practices” section. |
| sdk/cosmos/azure-cosmos/CHANGELOG.md | Adjusts the 4.15.0 entry date. |
API Change CheckAPIView identified API level changes in this PR and created the following API reviews |
Co-authored-by: Copilot <[email protected]>
simorenoh
commented
Feb 12, 2026
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
annatisch
reviewed
Feb 18, 2026
sdk/cosmos/azure-cosmos/azure/cosmos/_availability_strategy_config.py
Outdated
Show resolved
Hide resolved
sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py
Outdated
Show resolved
Hide resolved
annatisch
approved these changes
Feb 19, 2026
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Member
Author
|
/azp run python - cosmos - tests |
|
Azure Pipelines successfully started running 1 pipeline(s). |
availability_strategy use
annatisch
approved these changes
Feb 19, 2026
tvaron3
approved these changes
Feb 19, 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.
Missed the fact that there were additional questions on the cross-regional hedging functionality and that we had exposed an inner policy. Addressing both of these here.
Updates availability_strategy to be bool/dict as opposed to just dict for easier usage.
The way
availability_strategyworks has been updated to the following at the client level:The way
availability_strategyworks has been updated to the following at the request level: