Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
from ._cosmos_http_logging_policy import CosmosHttpLoggingPolicy
from ._range_partition_resolver import RangePartitionResolver

PartitionKeyType = Union[str, int, float, bool, List[Union[str, int, float, bool]], Type[NonePartitionKeyValue]]
PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long


class CredentialDict(TypedDict, total=False):
Expand Down
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
# pylint: disable=protected-access, too-many-lines
# pylint: disable=missing-client-constructor-parameter-credential,missing-client-constructor-parameter-kwargs

PartitionKeyType = Union[str, int, float, bool, List[Union[str, int, float, bool]], Type[NonePartitionKeyValue]]
PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long


class ContainerProxy:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
from .._range_partition_resolver import RangePartitionResolver


PartitionKeyType = Union[str, int, float, bool, List[Union[str, int, float, bool]], Type[NonePartitionKeyValue]]
PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long
class CredentialDict(TypedDict, total=False):
masterKey: str
resourceTokens: Mapping[str, Any]
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ async def read(
async def create_container(
self,
id: str,
partition_key: Optional[PartitionKey],
partition_key: PartitionKey,
*,
indexing_policy: Optional[Dict[str, str]] = None,
default_ttl: Optional[int] = None,
Expand Down Expand Up @@ -265,7 +265,7 @@ async def create_container(
@distributed_trace_async
async def create_container_if_not_exists(
self,
id: str, # pylint: disable=redefined-builtin
id: str,
partition_key: PartitionKey,
**kwargs: Any
) -> ContainerProxy:
Expand Down
4 changes: 2 additions & 2 deletions sdk/cosmos/azure-cosmos/azure/cosmos/aio/_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# pylint: disable=protected-access
# pylint: disable=missing-client-constructor-parameter-credential,missing-client-constructor-parameter-kwargs

from typing import Any, Dict, List, Mapping, Union, Optional, Type, TYPE_CHECKING
from typing import Any, Dict, List, Mapping, Union, Optional, Type, Sequence, TYPE_CHECKING

from azure.core.async_paging import AsyncItemPaged
from azure.core.tracing.decorator_async import distributed_trace_async
Expand All @@ -39,7 +39,7 @@
from ._container import ContainerProxy


PartitionKeyType = Union[str, int, float, bool, List[Union[str, int, float, bool]], Type[NonePartitionKeyValue]]
PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long


class ScriptsProxy:
Expand Down
6 changes: 3 additions & 3 deletions sdk/cosmos/azure-cosmos/azure/cosmos/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
# pylint: disable=too-many-lines
# pylint: disable=missing-client-constructor-parameter-credential,missing-client-constructor-parameter-kwargs

PartitionKeyType = Union[str, int, float, bool, List[Union[str, int, float, bool]], Type[NonePartitionKeyValue]]
PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long


class ContainerProxy: # pylint: disable=too-many-public-methods
Expand Down Expand Up @@ -816,7 +816,7 @@ def execute_item_batch(
def delete_item( # pylint:disable=docstring-missing-param
self,
item: Union[Mapping[str, Any], str],
partition_key: Optional[PartitionKeyType],
partition_key: PartitionKeyType,
populate_query_metrics: Optional[bool] = None,
pre_trigger_include: Optional[str] = None,
post_trigger_include: Optional[str] = None,
Expand Down Expand Up @@ -1028,7 +1028,7 @@ def query_conflicts(
def get_conflict(
self,
conflict: Union[str, Mapping[str, Any]],
partition_key: Optional[PartitionKeyType],
partition_key: PartitionKeyType,
**kwargs: Any
) -> Dict[str, Any]:
"""Get the conflict identified by `conflict`.
Expand Down
6 changes: 4 additions & 2 deletions sdk/cosmos/azure-cosmos/azure/cosmos/scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"""Create, read, update and delete and execute scripts in the Azure Cosmos DB SQL API service.
"""

from typing import Any, Dict, List, Mapping, Union, Optional
from typing import Any, Dict, List, Mapping, Union, Optional, Type, Sequence

from azure.core.paging import ItemPaged
from azure.core.tracing.decorator import distributed_trace
Expand All @@ -34,6 +34,8 @@
# pylint: disable=protected-access
# pylint: disable=missing-client-constructor-parameter-credential,missing-client-constructor-parameter-kwargs

PartitionKeyType = Union[str, int, float, bool, Sequence[Union[str, int, float, bool, None]], Type[NonePartitionKeyValue]] # pylint: disable=line-too-long


class ScriptType:
StoredProcedure = "sprocs"
Expand Down Expand Up @@ -191,7 +193,7 @@ def delete_stored_procedure(self, sproc: Union[str, Mapping[str, Any]], **kwargs
def execute_stored_procedure(
self,
sproc: Union[str, Mapping[str, Any]],
partition_key: Optional[Union[str, bool, int, float, List[Union[str, bool, int, float]]]] = None,
partition_key: Optional[PartitionKeyType] = None,
params: Optional[List[Dict[str, Any]]] = None,
enable_script_logging: Optional[bool] = None,
**kwargs: Any
Expand Down