Skip to content
Closed
Changes from 1 commit
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
2550197
session container fixes
simorenoh Apr 3, 2025
bc80922
Merge branch 'main' into session_token_fixes
simorenoh May 4, 2025
6002825
Merge branch 'main' into session_token_fixes
simorenoh May 8, 2025
9cf54e7
async changes
simorenoh May 8, 2025
2320353
sync changes
simorenoh May 9, 2025
dcc11dd
mypy/pylint
simorenoh May 9, 2025
10c2c9a
Update _session.py
simorenoh May 9, 2025
2c7a2db
mark query plan as fetched for query
simorenoh May 9, 2025
1215129
Merge branch 'main' into session_token_fixes
simorenoh May 9, 2025
31a927e
adjust logic after merging
simorenoh May 12, 2025
73fa94c
Update _base.py
simorenoh May 12, 2025
450070a
Update _base.py
simorenoh May 12, 2025
7411502
tests - missing sync mwr
simorenoh May 12, 2025
b2fb943
sync mwr tests, test fixes
simorenoh May 13, 2025
6899cdb
Update test_session_async.py
simorenoh May 13, 2025
a79be96
Merge branch 'main' into session_token_fixes
simorenoh May 19, 2025
209d3d7
Update test_backwards_compatibility.py
simorenoh May 21, 2025
e80d2c7
Update test_backwards_compatibility.py
simorenoh May 22, 2025
24c36b8
Update test_backwards_compatibility_async.py
simorenoh May 23, 2025
d037304
Update test_backwards_compatibility_async.py
simorenoh May 23, 2025
a78d07d
Update test_backwards_compatibility.py
simorenoh May 23, 2025
d815374
Merge branch 'main' into session_token_fixes
simorenoh May 27, 2025
3ab0a06
Merge branch 'main' into session_token_fixes
simorenoh May 27, 2025
9ca6054
Update execution_dispatcher.py
simorenoh May 27, 2025
b806e20
merge leftovers
simorenoh May 27, 2025
34d63a8
slip
simorenoh May 27, 2025
82ff60c
Update test_backwards_compatibility.py
simorenoh May 28, 2025
b06ad7d
Update test_backwards_compatibility.py
simorenoh May 28, 2025
eb885dd
Update test_query_hybrid_search_async.py
simorenoh May 28, 2025
008ac69
further changes, changelog
simorenoh May 28, 2025
a800f28
Merge branch 'main' into session_token_fixes
simorenoh May 28, 2025
7775860
add tests
simorenoh May 28, 2025
da9eaf1
Merge branch 'session_token_fixes' of https://github.com/Azure/azure-…
simorenoh May 28, 2025
d4dd2d4
typehint
simorenoh May 28, 2025
7522407
Merge branch 'main' into session_token_fixes
simorenoh May 29, 2025
6c124bc
address comments
simorenoh May 29, 2025
2854cb5
Update _session.py
simorenoh May 29, 2025
cce381f
Update _base.py
simorenoh May 29, 2025
b20a89f
ci tests
simorenoh May 29, 2025
78f3827
Merge branch 'main' into session_token_fixes
simorenoh May 29, 2025
a5b18fe
merging main
simorenoh May 29, 2025
bc3d853
Update _cosmos_client_connection.py
simorenoh May 29, 2025
575ea0c
tests
simorenoh May 29, 2025
2a19516
change session token logic
simorenoh May 30, 2025
f94098f
Update _session.py
simorenoh May 30, 2025
883c861
small fixes
simorenoh May 30, 2025
b274126
Update _session.py
simorenoh May 30, 2025
3918a5c
Update _session.py
simorenoh May 30, 2025
3327652
updates
simorenoh May 30, 2025
9e08f93
Merge branch 'main' into session_token_fixes
simorenoh May 30, 2025
c7b5ca5
update tests that checked for compound tokens - this will no longer b…
simorenoh May 30, 2025
9417196
Update test_config.py
simorenoh Jun 2, 2025
525ad6c
Update execution_dispatcher.py
simorenoh Jun 2, 2025
d1a014f
remove query logic
simorenoh Jun 2, 2025
5c825e7
remove partition split testing
simorenoh Jun 2, 2025
76f707b
oylint
simorenoh Jun 2, 2025
29ea4b1
Update dev_requirements.txt
simorenoh Jun 4, 2025
8a5def6
Merge branch 'main' into session_token_fixes
simorenoh Jun 9, 2025
9123dfe
delete duplicate
simorenoh Jun 10, 2025
ad35674
Merge branch 'main' into session_token_fixes
simorenoh Jun 10, 2025
d49c983
Merge branch 'main' into session_token_fixes
simorenoh Jun 11, 2025
8b22152
Merge branch 'main' into session_token_fixes
simorenoh Jun 11, 2025
c7fddc4
Merge remote-tracking branch 'upstream/main' into session_token_fixes
bambriz Jun 12, 2025
8be9ffe
Merge remote-tracking branch 'upstream/main' into session_token_fixes
bambriz Jun 17, 2025
69af540
update tests for partition split
bambriz Jun 19, 2025
38dbb79
Merge branch 'main' into session_token_fixes
simorenoh Jul 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update test_backwards_compatibility.py
  • Loading branch information
simorenoh committed May 23, 2025
commit a78d07d6aa1a5c29fb6ec44377a0a8c2f178b440
31 changes: 6 additions & 25 deletions sdk/cosmos/azure-cosmos/tests/test_backwards_compatibility.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,6 @@ def test_session_token_compatibility(self):
assert database_read is not None
self.client.delete_database(database2.id, session_token=str(uuid.uuid4()))
self.client.delete_database(database.id, session_token=str(uuid.uuid4()))
try:
database2.read()
pytest.fail("Database read should have failed")
except CosmosHttpResponseError as e:
assert e.status_code == 404

# Container
container = self.databaseForTest.create_container(str(uuid.uuid4()), PartitionKey(path="/pk"), session_token=str(uuid.uuid4()))
Expand All @@ -96,11 +91,6 @@ def test_session_token_compatibility(self):
assert 'defaultTtl' in replace_container_read # Check for default_ttl as a new additional property
self.databaseForTest.delete_container(replace_container.id, session_token=str(uuid.uuid4()))
self.databaseForTest.delete_container(container.id, session_token=str(uuid.uuid4()))
try:
container2.read()
pytest.fail("Container read should have failed")
except CosmosHttpResponseError as e:
assert e.status_code == 404

def test_etag_match_condition_compatibility(self):
# Verifying that behavior is unaffected across the board for using `etag`/`match_condition` on irrelevant methods
Expand All @@ -110,33 +100,24 @@ def test_etag_match_condition_compatibility(self):
database2 = self.client.create_database_if_not_exists(str(uuid.uuid4()), etag=str(uuid.uuid4()), match_condition=MatchConditions.IfNotModified)
assert database2 is not None
self.client.delete_database(database2.id, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)
try:
database2.read()
pytest.fail("Database read should have failed")
except CosmosHttpResponseError as e:
assert e.status_code == 404
self.client.delete_database(database.id, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)

# Container
container = database.create_container(str(uuid.uuid4()), PartitionKey(path="/pk"),
container = self.databaseForTest.create_container(str(uuid.uuid4()), PartitionKey(path="/pk"),
etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)
assert container is not None
container2 = database.create_container_if_not_exists(str(uuid.uuid4()), PartitionKey(path="/pk"),
container2 = self.databaseForTest.create_container_if_not_exists(str(uuid.uuid4()), PartitionKey(path="/pk"),
etag=str(uuid.uuid4()), match_condition=MatchConditions.IfNotModified)
assert container2 is not None
container2_read = container2.read()
assert container2_read is not None
replace_container = database.replace_container(container2, PartitionKey(path="/pk"), default_ttl=30,
replace_container = self.databaseForTest.replace_container(container2, PartitionKey(path="/pk"), default_ttl=30,
etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)
replace_container_read = replace_container.read()
assert replace_container is not None
assert replace_container_read != container2_read
assert 'defaultTtl' in replace_container_read # Check for default_ttl as a new additional property
database.delete_container(replace_container.id, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)
try:
container2.read()
pytest.fail("Container read should have failed")
except CosmosHttpResponseError as e:
assert e.status_code == 404
self.databaseForTest.delete_container(replace_container.id, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)

# Item
item = container.create_item({"id": str(uuid.uuid4()), "pk": 0}, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)
Expand All @@ -159,7 +140,7 @@ def test_etag_match_condition_compatibility(self):
for result in batch_results:
assert result['statusCode'] in (200, 201)

self.client.delete_database(database.id)
self.databaseForTest.delete_container(container.id, etag=str(uuid.uuid4()), match_condition=MatchConditions.IfModified)

if __name__ == "__main__":
unittest.main()
Loading