Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
elevate kwargs for sync client, other small fixes
  • Loading branch information
simorenoh committed Feb 7, 2024
commit e277e1e4678a32b6d097eb93c045ea523ae6aa35
9 changes: 4 additions & 5 deletions sdk/cosmos/azure-cosmos/azure/cosmos/aio/_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,6 @@ async def read_item(
request_options = _build_options(kwargs)

request_options["partitionKey"] = await self._set_partition_key(partition_key)
max_integrated_cache_staleness_in_ms = kwargs.pop('max_integrated_cache_staleness_in_ms', None)
if max_integrated_cache_staleness_in_ms is not None:
validate_cache_staleness_value(max_integrated_cache_staleness_in_ms)
request_options["maxIntegratedCacheStaleness"] = max_integrated_cache_staleness_in_ms
Expand Down Expand Up @@ -379,6 +378,7 @@ def query_items(
initial_headers: Optional[Dict[str, str]] = None,
max_integrated_cache_staleness_in_ms: Optional[int] = None,
priority_level: Optional[Literal["High", "Low"]] = None,
continuation_token_limit: Optional[int] = None,
**kwargs: Any
) -> AsyncItemPaged[Dict[str, Any]]:
"""Return all results matching the given `query`.
Expand Down Expand Up @@ -407,9 +407,9 @@ def query_items(
:keyword dict[str, str] initial_headers: Initial headers to be sent as part of the request.
:keyword response_hook: A callable invoked with the response metadata.
:paramtype response_hook: Callable[[Dict[str, str], AsyncItemPaged[Dict[str, Any]]], None]
:keyword int continuation_token_limit: **provisional** The size limit in kb of the
response continuation token in the query response. Valid values are positive integers.
A value of 0 is the same as not passing a value (default no limit).
:keyword int continuation_token_limit: The size limit in kb of the response continuation token in the query
response. Valid values are positive integers.
A value of 0 is the same as not passing a value (default no limit).
:keyword int max_integrated_cache_staleness_in_ms: The max cache staleness for the integrated cache in
milliseconds. For accounts configured to use the integrated cache, using Session or Eventual consistency,
responses are guaranteed to be no staler than this value.
Expand Down Expand Up @@ -463,7 +463,6 @@ def query_items(
feed_options["maxIntegratedCacheStaleness"] = max_integrated_cache_staleness_in_ms
correlated_activity_id = GenerateGuidId()
feed_options["correlatedActivityId"] = correlated_activity_id
continuation_token_limit = kwargs.pop("continuation_token_limit", None)
if continuation_token_limit is not None:
feed_options["responseContinuationTokenLimitInKb"] = continuation_token_limit
if hasattr(response_hook, "clear"):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ def _build_auth(credential: CredentialType) -> CredentialDict:
"such as ClientSecretCredential).")
return auth


def _build_connection_policy(kwargs: Dict[str, Any]) -> ConnectionPolicy:
# pylint: disable=protected-access
policy = kwargs.pop('connection_policy', None) or ConnectionPolicy()
Expand Down
8 changes: 4 additions & 4 deletions sdk/cosmos/azure-cosmos/azure/cosmos/aio/_scripts.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ class ScriptsProxy:
"""

def __init__(
self,
container: "ContainerProxy",
client_connection: _CosmosClientConnection,
container_link: str
self,
container: "ContainerProxy",
client_connection: _CosmosClientConnection,
container_link: str
) -> None:
self.client_connection = client_connection
self.container_link = container_link
Expand Down
Loading