Skip to content

Update Session Token Sample and Retry Documentation #42250

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

Merged
merged 3 commits into from
Jul 29, 2025

Conversation

tvaron3
Copy link
Member

@tvaron3 tvaron3 commented Jul 29, 2025

Description

  • Fixed session token sample to be clear that the token being used for every request comes from the cache.
  • Updated retry documentation

@Copilot Copilot AI review requested due to automatic review settings July 29, 2025 00:50
@tvaron3 tvaron3 requested a review from a team as a code owner July 29, 2025 00:50
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR improves the Cosmos DB Python SDK's session token management samples and retry documentation. The changes clarify how session tokens should be retrieved from cache and streamline the code structure while also updating retry behavior documentation to be more accurate.

Key changes:

  • Refactored session token samples to properly demonstrate using cached session tokens for requests
  • Updated retry documentation to reflect current SDK behavior for error codes 408, 500, and 503

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 7 comments.

File Description
session_token_management_async.py Refactored to extract shared logic into a new function and properly use cached session tokens
session_token_management.py Applied the same refactoring as the async version for consistency
ErrorCodesAndRetries.md Updated retry behavior documentation for status codes 408, 500, and 503

Copy link
Member

@kushagraThapar kushagraThapar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes @tvaron3 , lgtm!

@tvaron3 tvaron3 merged commit f1498d7 into Azure:main Jul 29, 2025
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants