Skip to content

[Cosmos] Fix mismatching type of ConsistencyPolicy with docstring#43150

Merged
simorenoh merged 4 commits intoAzure:mainfrom
allenkim0129:users/allekim/fix/typeMismatch
Oct 6, 2025
Merged

[Cosmos] Fix mismatching type of ConsistencyPolicy with docstring#43150
simorenoh merged 4 commits intoAzure:mainfrom
allenkim0129:users/allekim/fix/typeMismatch

Conversation

@allenkim0129
Copy link
Copy Markdown
Contributor

@allenkim0129 allenkim0129 commented Sep 26, 2025

Description

Tackling the bullet point items related to ConsistencyPolicy type hint for GA release: #43211

The typehint for ConsistencyPolicy in docstring and actual code were mismatching. This fix will sync the typehints for them.

All SDK Contribution checklist:

  • The pull request does not introduce [breaking changes]
  • CHANGELOG is updated for new features, bug fixes or other significant changes.
  • I have read the contribution guidelines.

General Guidelines and Best Practices

  • Title of the pull request is clear and informative.
  • There are a small number of commits, each of which have an informative message. This means that previously merged commits do not appear in the history of the PR. For more information on cleaning up the commits in your PR, see this page.

Testing Guidelines

  • Pull request includes test coverage for the included changes.

@allenkim0129 allenkim0129 requested a review from a team as a code owner September 26, 2025 21:33
Copilot AI review requested due to automatic review settings September 26, 2025 21:33
Copy link
Copy Markdown
Contributor

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 fixes a type annotation mismatch for the ConsistencyPolicy attribute in the DatabaseAccount class. The docstring type hint and actual code implementation had inconsistent type annotations.

  • Updates docstring type annotation from Dict[str, Union[str, int]] to dict[str, str]
  • Updates instance variable type annotation from Optional[UserConsistencyPolicy] to Optional[dict[str, str]]

Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/documents.py Outdated
Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/documents.py Outdated
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Sep 26, 2025

API Change Check

APIView identified API level changes in this PR and created the following API reviews

azure-cosmos

Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/documents.py
Comment thread sdk/cosmos/azure-cosmos/azure/cosmos/documents.py Outdated
Copy link
Copy Markdown
Member

@tvaron3 tvaron3 left a comment

Choose a reason for hiding this comment

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

LGTM

@allenkim0129 allenkim0129 mentioned this pull request Oct 6, 2025
13 tasks
@simorenoh simorenoh merged commit 9376f1e into Azure:main Oct 6, 2025
21 checks passed
@allenkim0129 allenkim0129 changed the title Fix mismatching type of ConsistencyPolicy with docstring [Cosmos] Fix mismatching type of ConsistencyPolicy with docstring Oct 6, 2025
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.

5 participants