-
Notifications
You must be signed in to change notification settings - Fork 3.2k
Closed
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.Cosmoscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that
Description
Describe the bug
First off, thanks for all the typing you all have added!
Our partition_keys are always strings so we'd like our internal methods to have type Union[str, list[str], None], but that's not compatible with the PartitionKeyType in the SDK because lists are mutable
GitHub issue with explanation of why list[str] isn't compatible with e.g. list[str | int]
Assuming these functions never modify the partition_keys that are passed in, so could we change that type from List to Sequence?
To Reproduce
mypy playground: List failure case
mypy playground: Sequence success case
Expected behavior
Users of the sdk can restrict their partition key types to a stricter subset
Metadata
Metadata
Assignees
Labels
ClientThis issue points to a problem in the data-plane of the library.This issue points to a problem in the data-plane of the library.Cosmoscustomer-reportedIssues that are reported by GitHub users external to the Azure organization.Issues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as thatThe issue doesn't require a change to the product in order to be resolved. Most issues start as that