Skip to content

[Cosmos] Api review follow-ups #43211

@simorenoh

Description

@simorenoh
  • 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:
Image
  • methods like get_conflict still say they return Dict[str, Any] even thought they also return CosmosDict at this point - we should go through all the public APIs and verify that their return types are updated to reflect this if it applies (at this point it should apply to most methods)
  • overloads for the query_items methods are all missing return types
  • query_items overloads should be updated to reflect the behavior being outlined here:
Image
  • default max_concurrency value for any default threadpool usage (only read_items right now I believe) should be made optional, and left to the default value in the native Python library unless customers have the resources/ want to set it higher:
Image
  • replace_throughput method had the response_hook taken away - which is a breaking change. need to add this back:
Image
  • new InternalException should be marked as private by using an underscore, since it should not be something for users to use
  • 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
  • update CosmosDict and CosmosList to only inherit the built-in type for dict and list respectively instead of the current typing variant - as well as change List and Dict imports
  • update minimum version to 3.9 aligning with the above as well - Core dropped support for 3.8 already 6 months ago [Core] Drop Python 3.8 support #40831:
Image
  • the new overloads added for the create_database and create_database_if_not_exists methods missed the response_hook arg being included, as well as including some enhancements that were previously mentioned:
Image
  • The typehint for ConsistencyPolicy in docstring and actual code were mismatching. Fix mismatching type of ConsistencyPolicy with docstring.

Metadata

Metadata

Assignees

Labels

ClientThis issue points to a problem in the data-plane of the library.Cosmoscosmos-python-p0

Type

No type

Projects

Status

No status

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions