Skip to content

Conversation

allenkim0129
Copy link
Contributor

Description

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 Copilot AI review requested due to automatic review settings September 26, 2025 21:33
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 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]]

Copy link

API Change Check

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

azure-cosmos

:ivar ConsistencyPolicy:
UserConsistencyPolicy settings.
:vartype ConsistencyPolicy: Dict[str, Union[str, int]]
:vartype ConsistencyPolicy: dict[str, str]
Copy link
Member

Choose a reason for hiding this comment

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

Is this always going to be dict[str, str]? We don't want to change this later.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, the type will always be dict[str, str]

Copy link
Member

Choose a reason for hiding this comment

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

Just to clarify, I was referring specifically to the value type - there's never going to be ints or booleans in this dictionary?
Unless something is a protocol that requires a mapping of strings, we usually stick with dict[str, Any].
But if your service mandates that these be string properties, then this is fine.

Copy link
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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

3 participants