Skip to content

Conversation

simorenoh
Copy link
Member

@simorenoh simorenoh commented Oct 3, 2025

Tackling some of the bullet points from the api review for our next GA release: #43211

Items tackled here:

  • re-add SERVICE_UNAVAILABLE = 503 to the constants file - it was probably removed due to it being un-used, but it will now have special casing with PPAF anyway
  • new InternalException should be marked as private by using an underscore, since it should not be something for users to use
  • update the typing of excluded_locations: Optional[list[str]] to excluded_locations: Optional[Sequence[str]] across the SDK
  • _PartitionKeyType was made private - which doesn't make sense if it applies to all the public APIs that use partition keys. we should likely expose this instead

@simorenoh simorenoh requested a review from a team as a code owner October 3, 2025 18:06
@Copilot Copilot AI review requested due to automatic review settings October 3, 2025 18:06
@github-actions github-actions bot added the Cosmos label Oct 3, 2025
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 makes the previously internal partition key type alias public and broadens excluded_locations parameter annotations from concrete lists to more general sequences, plus a small internal variable rename for clarity.

  • Exposes PartitionKeyType (removes leading underscore) and updates all references.
  • Updates excluded_locations annotations/docstrings from List[str] to Sequence[str].
  • Renames a local variable in partition health tracking for clearer semantics.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
partition_key.py Makes PartitionKeyType public by removing underscore.
container.py Replaces usages of _PartitionKeyType with PartitionKeyType; widens excluded_locations type hints/docstrings to Sequence.
aio/_cosmos_client_connection_async.py Async equivalents updated to public PartitionKeyType and Sequence annotations.
aio/_container.py Async container updates similar to sync version.
_read_items_helper.py TYPE_CHECKING imports and annotations updated to PartitionKeyType.
_query_builder.py TYPE_CHECKING annotations updated to PartitionKeyType.
_partition_health_tracker.py Renames internal variable excluded_locations to unhealthy_locations for clarity.
_cosmos_client_connection.py Updates to PartitionKeyType; adjusts internal query plan method parameter typing.

@simorenoh simorenoh mentioned this pull request Oct 3, 2025
13 tasks
@simorenoh simorenoh changed the title [Cosmos] make PartitionKeyType public, mark excluded locations as sequence [Cosmos] make PartitionKeyType public, mark excluded locations as sequence, make InternalException private Oct 3, 2025
Copy link

github-actions bot commented Oct 3, 2025

API Change Check

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

azure-cosmos

Copy link
Contributor

@allenkim0129 allenkim0129 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@allenkim0129 allenkim0129 left a comment

Choose a reason for hiding this comment

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

LGTM

@simorenoh
Copy link
Member Author

/azp run python - cosmos - ci

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@simorenoh
Copy link
Member Author

/check-enforcer override

@simorenoh simorenoh closed this Oct 7, 2025
@simorenoh simorenoh reopened this Oct 7, 2025
@simorenoh simorenoh merged commit 13be40c into main Oct 7, 2025
23 checks passed
@simorenoh simorenoh deleted the public-api-fixes branch October 7, 2025 18:02
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.

3 participants