diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 88216cd2235f..e8abbd59d18c 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -2,6 +2,10 @@ ### 4.3.0b5 (Unreleased) +#### Breaking Changes +- Bugfix: Automatic Id generation for items was turned on for `upsert_items()` method when no 'id' value was present in document body. +Method call will now require an 'id' field to be present in the document body. + #### Other Changes - Marked the GetAuthorizationMethod for deprecation since it will no longer be public in a future release. - Added samples showing how to configure retry options for both the sync and async clients. diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/container.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/container.py index 50c47c4026fd..58c67b07d7c6 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/container.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/container.py @@ -445,7 +445,7 @@ async def upsert_item( """ request_options = _build_options(kwargs) response_hook = kwargs.pop('response_hook', None) - request_options["disableIdGeneration"] = True + request_options["disableAutomaticIdGeneration"] = True if pre_trigger_include is not None: request_options["preTriggerInclude"] = pre_trigger_include if post_trigger_include is not None: @@ -492,7 +492,7 @@ async def replace_item( item_link = self._get_document_link(item) request_options = _build_options(kwargs) response_hook = kwargs.pop('response_hook', None) - request_options["disableIdGeneration"] = True + request_options["disableAutomaticIdGeneration"] = True if pre_trigger_include is not None: request_options["preTriggerInclude"] = pre_trigger_include if post_trigger_include is not None: diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/container.py b/sdk/cosmos/azure-cosmos/azure/cosmos/container.py index 1658f6e957d4..9f075eba64d5 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/container.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/container.py @@ -426,7 +426,7 @@ def replace_item( item_link = self._get_document_link(item) request_options = build_options(kwargs) response_hook = kwargs.pop('response_hook', None) - request_options["disableIdGeneration"] = True + request_options["disableAutomaticIdGeneration"] = True if populate_query_metrics is not None: request_options["populateQueryMetrics"] = populate_query_metrics if pre_trigger_include is not None: @@ -472,7 +472,7 @@ def upsert_item( """ request_options = build_options(kwargs) response_hook = kwargs.pop('response_hook', None) - request_options["disableIdGeneration"] = True + request_options["disableAutomaticIdGeneration"] = True if populate_query_metrics is not None: request_options["populateQueryMetrics"] = populate_query_metrics if pre_trigger_include is not None: