Skip to content

Commit

Permalink
Fixing LINT issues
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianMeiswinkel committed Sep 19, 2024
1 parent 79a9bb6 commit f9bfaa0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion sdk/cosmos/azure-cosmos/azure/cosmos/_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def GetHeaders( # pylint: disable=too-many-statements,too-many-branches
if options.get("correlatedActivityId"):
headers[http_constants.HttpHeaders.CorrelatedActivityId] = options["correlatedActivityId"]

if resource_type is "docs" and verb is not "get":
if resource_type == "docs" and verb != "get":
responsePayloadOnWriteDisabled = options.pop(
"responsePayloadOnWriteDisabled",
cosmos_client_connection.connection_policy.ResponsePayloadOnWriteDisabled)
Expand Down
16 changes: 9 additions & 7 deletions sdk/cosmos/azure-cosmos/azure/cosmos/container.py
Original file line number Diff line number Diff line change
Expand Up @@ -541,10 +541,11 @@ def replace_item( # pylint:disable=docstring-missing-param
:keyword Literal["High", "Low"] priority: Priority based execution allows users to set a priority for each
request. Once the user has reached their provisioned throughput, low priority requests are throttled
before high priority requests start getting throttled. Feature must first be enabled at the account level.
:keyword bool response_payload_on_write_disabled: Indicates whether service should be instructed to skip sending
response payloads. When not specified explicitly here, the default value will be determined from kwargs or
when also not specified there from client-level kwargs.
:returns: A dict representing the item after replace went through or if response payload on write is disabled None.
:keyword bool response_payload_on_write_disabled: Indicates whether service should be instructed to skip
sending response payloads. When not specified explicitly here, the default value will be determined from
kwargs or when also not specified there from client-level kwargs.
:returns: A dict representing the item after replace went through or if response payload on write is disabled
None.
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: The replace operation failed or the item with
given id does not exist.
:rtype: Optional[Dict[str, Any]]
Expand All @@ -565,7 +566,7 @@ def replace_item( # pylint:disable=docstring-missing-param
if match_condition is not None:
kwargs['match_condition'] = match_condition
if response_payload_on_write_disabled is not None:
kwargs['response_payload_on_write_disabled'] = response_payload_on_write_disabled
kwargs['response_payload_on_write_disabled'] = response_payload_on_write_disabled
request_options = build_options(kwargs)
request_options["disableAutomaticIdGeneration"] = True
if populate_query_metrics is not None:
Expand Down Expand Up @@ -638,7 +639,7 @@ def upsert_item( # pylint:disable=docstring-missing-param
if match_condition is not None:
kwargs['match_condition'] = match_condition
if response_payload_on_write_disabled is not None:
kwargs['response_payload_on_write_disabled'] = response_payload_on_write_disabled
kwargs['response_payload_on_write_disabled'] = response_payload_on_write_disabled
request_options = build_options(kwargs)
request_options["disableAutomaticIdGeneration"] = True
if populate_query_metrics is not None:
Expand Down Expand Up @@ -777,7 +778,8 @@ def patch_item(
:keyword bool response_payload_on_write_disabled: Indicates whether service should be instructed to skip sending
response payloads. When not specified explicitly here, the default value will be determined from kwargs or
when also not specified there from client-level kwargs.
:returns: A dict representing the item after the patch operations went through or if response payload on write is disabled None.
:returns: A dict representing the item after the patch operations went through or if response payload on write
is disabled None.
:raises ~azure.cosmos.exceptions.CosmosHttpResponseError: The patch operations failed or the item with
given id does not exist.
:rtype: Optional[Dict[str, Any]]
Expand Down
3 changes: 2 additions & 1 deletion sdk/cosmos/azure-cosmos/azure/cosmos/cosmos_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class CosmosClient: # pylint: disable=client-accepts-api-version-keyword
Must be used along with a logger to work.
:keyword ~logging.Logger logger: Logger to be used for collecting request diagnostics. Can be passed in at client
level (to log all requests) or at a single request level. Requests will be logged at INFO level.
:keyword bool response_payload_on_write_disabled: Indicates whether service should be instructed to skip sending response payloads.
:keyword bool response_payload_on_write_disabled: Indicates whether service should be instructed to skip sending
response payloads.
.. admonition:: Example:
Expand Down

0 comments on commit f9bfaa0

Please sign in to comment.