Repository navigation
Added User Agent Suffix - #40904
Merged
Andrew Mathew (andrewmathew1) merged 10 commits intoMay 27, 2025
Merged
Added User Agent Suffix#40904Andrew Mathew (andrewmathew1) merged 10 commits into
Andrew Mathew (andrewmathew1) merged 10 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR adds support for a user agent suffix in both the synchronous and asynchronous Cosmos client implementations, allowing users to customize the user agent string. The key changes include:
- Introducing an optional user_agent_suffix keyword argument in the client constructors.
- Updating the internal functions in _utils.py to append the suffix when provided.
- Adding tests to verify that the user agent strings for both sync and async clients incorporate the specified suffixes.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| sdk/cosmos/azure-cosmos/tests/test_client_user_agent.py | Added tests for validating correct user agent suffix behavior. |
| sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py | Modified async connection to use user_agent_suffix through kwargs. |
| sdk/cosmos/azure-cosmos/azure/cosmos/_utils.py | Updated get_user_agent and get_user_agent_async to append suffix. |
| sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py | Modified sync connection to use user_agent_suffix through kwargs. |
Kevin Pilch (Pilchie)
approved these changes
May 6, 2025
added 2 commits
May 6, 2025 20:24
Andrew Mathew (andrewmathew1)
force-pushed
the
users/andrewmathew1/useragentsuffix
branch
from
May 7, 2025 00:28
3be2283 to
42467c7
Compare
Simon Moreno (simorenoh)
approved these changes
May 7, 2025
Collaborator
|
API change check API changes are not detected in this pull request. |
Tomas Varon (tvaron3)
requested changes
May 8, 2025
Tomas Varon (tvaron3)
approved these changes
May 12, 2025
Tomas Varon (tvaron3)
left a comment
Member
There was a problem hiding this comment.
Changelog but not blocking
Simon Moreno (simorenoh)
approved these changes
May 27, 2025
Andrew Mathew (andrewmathew1)
deleted the
users/andrewmathew1/useragentsuffix
branch
May 27, 2025 21:47
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
Added User Agent Suffix keyword argument to the client. Allowing users to pass in their user agent suffix to either the sync or async client.