Skip to content

Commit 4aa8d4f

Browse files
authored
[Cosmos] remove old code from VS scenarios (#44326)
* remove FTS-disable env var * Update hybrid_search_aggregator.py * Revert "Update hybrid_search_aggregator.py" This reverts commit d37fea6.
1 parent 90fc515 commit 4aa8d4f

13 files changed

+0
-42
lines changed

sdk/cosmos/azure-cosmos/README.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -816,11 +816,6 @@ Or if you'd like to add the optional parameters to the vector distance, you coul
816816
The `embeddings_string` above would be your string made from your vector embeddings.
817817
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.
818818

819-
*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
820-
not being able to recognize the new NonStreamingOrderBy capability that makes vector search possible.
821-
If this happens, you can set the `AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY` environment variable to `"True"` to opt out of this
822-
functionality and continue operating as usual.*
823-
824819
### Public Preview - Full Text Policy and Full Text Indexes
825820
We have added new capabilities to utilize full text policies and full text indexing for users to leverage full text search
826821
utilizing our Cosmos SDK. These two container-level configurations have to be turned on at the account-level

sdk/cosmos/azure-cosmos/azure/cosmos/_constants.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,6 @@ class _Constants:
5454
EnableMultipleWritableLocations: Literal["enableMultipleWriteLocations"] = "enableMultipleWriteLocations"
5555

5656
# Environment variables
57-
NON_STREAMING_ORDER_BY_DISABLED_CONFIG: str = "AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"
58-
NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT: str = "False"
5957
HS_MAX_ITEMS_CONFIG: str = "AZURE_COSMOS_HYBRID_SEARCH_MAX_ITEMS"
6058
HS_MAX_ITEMS_CONFIG_DEFAULT: int = 1000
6159
MAX_ITEM_BUFFER_VS_CONFIG: str = "AZURE_COSMOS_MAX_ITEM_BUFFER_VECTOR_SEARCH"

sdk/cosmos/azure-cosmos/azure/cosmos/_cosmos_client_connection.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3390,15 +3390,6 @@ def _GetQueryPlanThroughGateway(self, query: str, resource_link: str,
33903390
documents._QueryFeature.HybridSearch + "," +
33913391
documents._QueryFeature.CountIf + "," +
33923392
documents._QueryFeature.WeightedRankFusion)
3393-
if os.environ.get(Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG,
3394-
Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT) == "True":
3395-
supported_query_features = (documents._QueryFeature.Aggregate + "," +
3396-
documents._QueryFeature.CompositeAggregate + "," +
3397-
documents._QueryFeature.Distinct + "," +
3398-
documents._QueryFeature.MultipleOrderBy + "," +
3399-
documents._QueryFeature.OffsetAndLimit + "," +
3400-
documents._QueryFeature.OrderBy + "," +
3401-
documents._QueryFeature.Top)
34023393

34033394
options = {
34043395
"contentType": runtime_constants.MediaTypes.Json,

sdk/cosmos/azure-cosmos/azure/cosmos/aio/_cosmos_client_connection_async.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3409,15 +3409,6 @@ async def _GetQueryPlanThroughGateway(self, query: str, resource_link: str,
34093409
documents._QueryFeature.HybridSearch + "," +
34103410
documents._QueryFeature.CountIf + "," +
34113411
documents._QueryFeature.WeightedRankFusion)
3412-
if os.environ.get(Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG,
3413-
Constants.NON_STREAMING_ORDER_BY_DISABLED_CONFIG_DEFAULT) == "True":
3414-
supported_query_features = (documents._QueryFeature.Aggregate + "," +
3415-
documents._QueryFeature.CompositeAggregate + "," +
3416-
documents._QueryFeature.Distinct + "," +
3417-
documents._QueryFeature.MultipleOrderBy + "," +
3418-
documents._QueryFeature.OffsetAndLimit + "," +
3419-
documents._QueryFeature.OrderBy + "," +
3420-
documents._QueryFeature.Top)
34213412

34223413
options = {
34233414
"contentType": runtime_constants.MediaTypes.Json,

sdk/cosmos/azure-cosmos/tests/test_aggregate.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,6 @@ def _setup(cls):
5555
cls.client = cosmos_client.CosmosClient(_config.host, _config.master_key)
5656
cls.created_db = cls.client.get_database_client(test_config.TestConfig.TEST_DATABASE_ID)
5757
cls.created_collection = cls._create_collection(cls.created_db)
58-
if _config.host == "https://localhost:8081/":
59-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
6058

6159
# test documents
6260
document_definitions = []

sdk/cosmos/azure-cosmos/tests/test_multi_orderby.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,6 @@ class TestMultiOrderBy(unittest.TestCase):
4343
def setUpClass(cls):
4444
cls.client = cosmos_client.CosmosClient(cls.host, cls.masterKey)
4545
cls.database = cls.client.get_database_client(cls.configs.TEST_DATABASE_ID)
46-
if cls.host == "https://localhost:8081/":
47-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
4846

4947
def generate_multi_orderby_item(self):
5048
item = {'id': str(uuid.uuid4()), self.NUMBER_FIELD: random.randint(0, 5),

sdk/cosmos/azure-cosmos/tests/test_partition_split_query.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,6 @@ def setUpClass(cls):
5151
id=cls.TEST_CONTAINER_ID,
5252
partition_key=PartitionKey(path="/id"),
5353
offer_throughput=cls.throughput)
54-
if cls.host == "https://localhost:8081/":
55-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
5654

5755
@classmethod
5856
def tearDownClass(cls) -> None:

sdk/cosmos/azure-cosmos/tests/test_query.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,6 @@ def setUpClass(cls):
3838
use_multiple_write_locations = True
3939
cls.client = cosmos_client.CosmosClient(cls.host, cls.credential, multiple_write_locations=use_multiple_write_locations)
4040
cls.created_db = cls.client.get_database_client(cls.TEST_DATABASE_ID)
41-
if cls.host == "https://localhost:8081/":
42-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
4341

4442
def test_first_and_last_slashes_trimmed_for_query_string(self):
4543
created_collection = self.created_db.create_container(

sdk/cosmos/azure-cosmos/tests/test_query_async.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,6 @@ async def asyncSetUp(self):
4949
self.client = CosmosClient(self.host, self.masterKey, multiple_write_locations=self.use_multiple_write_locations)
5050
await self.client.__aenter__()
5151
self.created_db = self.client.get_database_client(self.TEST_DATABASE_ID)
52-
if self.host == "https://localhost:8081/":
53-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
5452

5553
async def asyncTearDown(self):
5654
await self.client.close()

sdk/cosmos/azure-cosmos/tests/test_query_cross_partition.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,6 @@ def setUpClass(cls):
4444
use_multiple_write_locations = True
4545
cls.client = cosmos_client.CosmosClient(cls.host, cls.masterKey, multiple_write_locations=use_multiple_write_locations)
4646
cls.created_db = cls.client.get_database_client(cls.TEST_DATABASE_ID)
47-
if cls.host == "https://localhost:8081/":
48-
os.environ["AZURE_COSMOS_DISABLE_NON_STREAMING_ORDER_BY"] = "True"
4947

5048
def setUp(self):
5149
self.created_container = self.created_db.create_container(

0 commit comments

Comments
 (0)