From 7d7eae02c5f333414768a83dd03c11b8bb9f8032 Mon Sep 17 00:00:00 2001 From: simorenoh Date: Mon, 12 Feb 2024 12:29:16 -0800 Subject: [PATCH 1/4] fixes --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 1 + sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py | 3 ++- sdk/cosmos/azure-cosmos/azure/cosmos/database.py | 3 ++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 988e7ca7adb5..104668a8a39f 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -7,6 +7,7 @@ #### Breaking Changes #### Bugs Fixed +* Keyword arguments were not being passed down for `create_container_if_not_exists()` methods. See [PR](). #### Other Changes * Marked `computed_properties` keyword as provisional, un-marked `continuation_token_limit` as provisional. See [PR 34207](https://github.com/Azure/azure-sdk-for-python/pull/34207). diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py index 59165914cc3e..3fc87f294dfe 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py @@ -324,7 +324,8 @@ async def create_container_if_not_exists( unique_key_policy=unique_key_policy, conflict_resolution_policy=conflict_resolution_policy, analytical_storage_ttl=analytical_storage_ttl, - computed_properties=computed_properties + computed_properties=computed_properties, + **kwargs ) def get_container_client(self, container: Union[str, ContainerProxy, Dict[str, Any]]) -> ContainerProxy: diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py index b923864aa20f..6d6a6a006341 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py @@ -327,7 +327,8 @@ def create_container_if_not_exists( # pylint:disable=docstring-missing-param unique_key_policy=unique_key_policy, conflict_resolution_policy=conflict_resolution_policy, analytical_storage_ttl=analytical_storage_ttl, - computed_properties=computed_properties + computed_properties=computed_properties, + **kwargs ) @distributed_trace From 8687b2b6931c5ae24643ec26faf708c67e128023 Mon Sep 17 00:00:00 2001 From: simorenoh Date: Mon, 12 Feb 2024 12:36:53 -0800 Subject: [PATCH 2/4] Update CHANGELOG.md --- sdk/cosmos/azure-cosmos/CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/cosmos/azure-cosmos/CHANGELOG.md b/sdk/cosmos/azure-cosmos/CHANGELOG.md index 104668a8a39f..f2a4bbea593b 100644 --- a/sdk/cosmos/azure-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-cosmos/CHANGELOG.md @@ -7,7 +7,7 @@ #### Breaking Changes #### Bugs Fixed -* Keyword arguments were not being passed down for `create_container_if_not_exists()` methods. See [PR](). +* Keyword arguments were not being passed down for `create_container_if_not_exists()` methods. See [PR 34286](https://github.com/Azure/azure-sdk-for-python/pull/34286). #### Other Changes * Marked `computed_properties` keyword as provisional, un-marked `continuation_token_limit` as provisional. See [PR 34207](https://github.com/Azure/azure-sdk-for-python/pull/34207). From 970e4340ddc6113502bff97f934fe96e8885f351 Mon Sep 17 00:00:00 2001 From: simorenoh Date: Tue, 13 Feb 2024 11:09:45 -0800 Subject: [PATCH 3/4] fixed missing kwargs --- sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py | 4 ++++ sdk/cosmos/azure-cosmos/azure/cosmos/database.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py index 3fc87f294dfe..2451162be89f 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_database.py @@ -310,6 +310,8 @@ async def create_container_if_not_exists( analytical_storage_ttl = kwargs.pop("analytical_storage_ttl", None) offer_throughput = kwargs.pop('offer_throughput', None) computed_properties = kwargs.pop("computed_properties", None) + etag = kwargs.pop("etag", None) + match_condition = kwargs.pop("match_condition", None) try: container_proxy = self.get_container_client(id) await container_proxy.read(**kwargs) @@ -325,6 +327,8 @@ async def create_container_if_not_exists( conflict_resolution_policy=conflict_resolution_policy, analytical_storage_ttl=analytical_storage_ttl, computed_properties=computed_properties, + etag=etag, + match_condition=match_condition, **kwargs ) diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py index 6d6a6a006341..707c6f03e039 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/database.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/database.py @@ -309,6 +309,8 @@ def create_container_if_not_exists( # pylint:disable=docstring-missing-param """ analytical_storage_ttl = kwargs.pop("analytical_storage_ttl", None) computed_properties = kwargs.pop("computed_properties", None) + etag = kwargs.pop("etag", None) + match_condition = kwargs.pop("match_condition", None) try: container_proxy = self.get_container_client(id) container_proxy.read( @@ -328,6 +330,8 @@ def create_container_if_not_exists( # pylint:disable=docstring-missing-param conflict_resolution_policy=conflict_resolution_policy, analytical_storage_ttl=analytical_storage_ttl, computed_properties=computed_properties, + etag=etag, + match_condition=match_condition, **kwargs ) From 9e3e8fac631d81bb027bab52423851894269f4da Mon Sep 17 00:00:00 2001 From: simorenoh Date: Wed, 6 Mar 2024 18:18:59 -0800 Subject: [PATCH 4/4] using PR to remove these wrongly-marked limitations --- sdk/cosmos/azure-cosmos/README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 663209b674d0..4bd8666c682b 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -153,15 +153,12 @@ Currently, the features below are **not supported**. For alternatives options, c * Group By queries * Queries with COUNT from a DISTINCT subquery: SELECT COUNT (1) FROM (SELECT DISTINCT C.ID FROM C) -* Transactional batch processing * Direct TCP Mode access * Continuation token support for aggregate cross-partition queries like sorting, counting, and distinct. Streamable queries like `SELECT * FROM WHERE` *do* support continuation tokens. * Change Feed: Processor * Change Feed: Read multiple partitions key values * Change Feed: Read specific time -* Change Feed: Read from the beginning -* Change Feed: Pull model * Cross-partition ORDER BY for mixed types * Enabling diagnostics for async query-type methods