diff --git a/sdk/cosmos/azure-cosmos/README.md b/sdk/cosmos/azure-cosmos/README.md index 4af8648925d1..597117eb8c78 100644 --- a/sdk/cosmos/azure-cosmos/README.md +++ b/sdk/cosmos/azure-cosmos/README.md @@ -816,11 +816,6 @@ Or if you'd like to add the optional parameters to the vector distance, you coul The `embeddings_string` above would be your string made from your vector embeddings. You can find our sync samples [here][cosmos_index_sample] and our async samples [here][cosmos_index_sample_async] as well to help yourself out. -*Note: For a limited time, if your query operates against a region or emulator that has not yet been updated the client might run into some issues -not being able to recognize the new NonStreamingOrderBy capability that makes vector search possible. -If this happens, you can set the `AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY` environment variable to `"True"` to opt out of this -functionality and continue operating as usual.* - ### Public Preview - Full Text Policy and Full Text Indexes We have added new capabilities to utilize full text policies and full text indexing for users to leverage full text search utilizing our Cosmos SDK. These two container-level configurations have to be turned on at the account-level diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py b/sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py index 303f4d3a674a..9902cd1d31ab 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py @@ -54,8 +54,6 @@ class _Constants: EnableMultipleWritableLocations: Literal["enableMultipleWriteLocations"] = "enableMultipleWriteLocations" # Environment variables - NON_STREAMING_ORDER_BY_DISABLED_CONFIG: str = "AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY" - NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT: str = "False" HS_MAX_ITEMS_CONFIG: str = "AZURE_COSMOS_HYBRID_SEARCH_MAX_ITEMS" HS_MAX_ITEMS_CONFIG_DEFAULT: int = 1000 MAX_ITEM_BUFFER_VS_CONFIG: str = "AZURE_COSMOS_MAX_ITEM_BUFFER_VECTOR_SEARCH" diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py b/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py index a1a101613f86..8e3e9f025630 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py @@ -3390,15 +3390,6 @@ def _GetQueryPlanThroughGateway(self, query: str, resource_link: str, documents._QueryFeature.HybridSearch + "," + documents._QueryFeature.CountIf + "," + documents._QueryFeature.WeightedRankFusion) - if os.environ.get(Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG, - Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT) == "True": - supported_query_features = (documents._QueryFeature.Aggregate + "," + - documents._QueryFeature.CompositeAggregate + "," + - documents._QueryFeature.Distinct + "," + - documents._QueryFeature.MultipleOrderBy + "," + - documents._QueryFeature.OffsetAndLimit + "," + - documents._QueryFeature.OrderBy + "," + - documents._QueryFeature.Top) options = { "contentType": runtime_constants.MediaTypes.Json, diff --git a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py index ba5d4afac8b5..e61e67f0a07c 100644 --- a/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py +++ b/sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py @@ -3409,15 +3409,6 @@ async def _GetQueryPlanThroughGateway(self, query: str, resource_link: str, documents._QueryFeature.HybridSearch + "," + documents._QueryFeature.CountIf + "," + documents._QueryFeature.WeightedRankFusion) - if os.environ.get(Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG, - Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT) == "True": - supported_query_features = (documents._QueryFeature.Aggregate + "," + - documents._QueryFeature.CompositeAggregate + "," + - documents._QueryFeature.Distinct + "," + - documents._QueryFeature.MultipleOrderBy + "," + - documents._QueryFeature.OffsetAndLimit + "," + - documents._QueryFeature.OrderBy + "," + - documents._QueryFeature.Top) options = { "contentType": runtime_constants.MediaTypes.Json, diff --git a/sdk/cosmos/azure-cosmos/tests/test_aggregate.py b/sdk/cosmos/azure-cosmos/tests/test_aggregate.py index 00473da37b64..ea841819a4d5 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_aggregate.py +++ b/sdk/cosmos/azure-cosmos/tests/test_aggregate.py @@ -55,8 +55,6 @@ def _setup(cls): cls.client = cosmos_client.CosmosClient(_config.host, _config.master_key) cls.created_db = cls.client.get_database_client(test_config.TestConfig.TEST_DATABASE_ID) cls.created_collection = cls._create_collection(cls.created_db) - if _config.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" # test documents document_definitions = [] diff --git a/sdk/cosmos/azure-cosmos/tests/test_multi_orderby.py b/sdk/cosmos/azure-cosmos/tests/test_multi_orderby.py index b521d758e52e..38699590b637 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_multi_orderby.py +++ b/sdk/cosmos/azure-cosmos/tests/test_multi_orderby.py @@ -43,8 +43,6 @@ class TestMultiOrderBy(unittest.TestCase): def setUpClass(cls): cls.client = cosmos_client.CosmosClient(cls.host, cls.masterKey) cls.database = cls.client.get_database_client(cls.configs.TEST_DATABASE_ID) - if cls.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" def generate_multi_orderby_item(self): item = {'id': str(uuid.uuid4()), self.NUMBER_FIELD: random.randint(0, 5), diff --git a/sdk/cosmos/azure-cosmos/tests/test_partition_split_query.py b/sdk/cosmos/azure-cosmos/tests/test_partition_split_query.py index c5dbfe651239..dab0f1be6d0d 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_partition_split_query.py +++ b/sdk/cosmos/azure-cosmos/tests/test_partition_split_query.py @@ -51,8 +51,6 @@ def setUpClass(cls): id=cls.TEST_CONTAINER_ID, partition_key=PartitionKey(path="/id"), offer_throughput=cls.throughput) - if cls.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" @classmethod def tearDownClass(cls) -> None: diff --git a/sdk/cosmos/azure-cosmos/tests/test_query.py b/sdk/cosmos/azure-cosmos/tests/test_query.py index 4970723e7757..bcf283932a53 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query.py @@ -38,8 +38,6 @@ def setUpClass(cls): use_multiple_write_locations = True cls.client = cosmos_client.CosmosClient(cls.host, cls.credential, multiple_write_locations=use_multiple_write_locations) cls.created_db = cls.client.get_database_client(cls.TEST_DATABASE_ID) - if cls.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" def test_first_and_last_slashes_trimmed_for_query_string(self): created_collection = self.created_db.create_container( diff --git a/sdk/cosmos/azure-cosmos/tests/test_query_async.py b/sdk/cosmos/azure-cosmos/tests/test_query_async.py index 40207abddf14..5cda55e88e70 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query_async.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query_async.py @@ -49,8 +49,6 @@ async def asyncSetUp(self): self.client = CosmosClient(self.host, self.masterKey, multiple_write_locations=self.use_multiple_write_locations) await self.client.__aenter__() self.created_db = self.client.get_database_client(self.TEST_DATABASE_ID) - if self.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" async def asyncTearDown(self): await self.client.close() diff --git a/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition.py b/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition.py index b1b4f050ab63..d3ccd204ecf7 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition.py @@ -44,8 +44,6 @@ def setUpClass(cls): use_multiple_write_locations = True cls.client = cosmos_client.CosmosClient(cls.host, cls.masterKey, multiple_write_locations=use_multiple_write_locations) cls.created_db = cls.client.get_database_client(cls.TEST_DATABASE_ID) - if cls.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" def setUp(self): self.created_container = self.created_db.create_container( diff --git a/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition_async.py b/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition_async.py index 70a990c64c19..73d76363b70b 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition_async.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query_cross_partition_async.py @@ -50,8 +50,6 @@ async def asyncSetUp(self): self.TEST_CONTAINER_ID, PartitionKey(path="/pk"), offer_throughput=test_config.TestConfig.THROUGHPUT_FOR_5_PARTITIONS) - if self.host == "https://localhost:8081/": - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True" async def asyncTearDown(self): try: diff --git a/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity.py b/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity.py index 398b505a520f..6339dfbc6639 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity.py @@ -134,7 +134,6 @@ def test_vector_search_environment_variables(self): "Please ensure you are using a limit smaller than the max, or change the max.") os.environ["AZURE_COSMOS_MAX_ITEM_BUFFER_VECTOR_SEARCH"] = "50000" - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "False" [item for item in self.created_large_container.query_items(query=query, enable_cross_partition_query=True)] def test_ordering_distances(self): diff --git a/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity_async.py b/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity_async.py index eb02d04dad95..a263e833461e 100644 --- a/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity_async.py +++ b/sdk/cosmos/azure-cosmos/tests/test_query_vector_similarity_async.py @@ -140,8 +140,6 @@ async def test_vector_search_environment_variables_async(self): "Please ensure you are using a limit smaller than the max, or change the max.") os.environ["AZURE_COSMOS_MAX_ITEM_BUFFER_VECTOR_SEARCH"] = "50000" - - os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "False" [item async for item in self.created_large_container.query_items(query=query)] async def test_ordering_distances_async(self):