From 94fd5a1ec7219893057f0777f380ebdbecf5c0e1 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Fri, 23 Apr 2021 14:52:50 -0400 Subject: [PATCH 1/8] delete_entity now takes an entity instead of row and partition key --- .../azure/data/tables/_table_batch.py | 21 ++++++++-------- .../azure/data/tables/_table_client.py | 7 +++--- .../data/tables/aio/_table_batch_async.py | 21 ++++++++-------- .../data/tables/aio/_table_client_async.py | 7 +++--- .../tests/test_table_batch.py | 8 +++--- .../tests/test_table_batch_async.py | 8 +++--- .../tests/test_table_batch_cosmos.py | 8 +++--- .../tests/test_table_batch_cosmos_async.py | 8 +++--- .../tests/test_table_entity.py | 25 +++++++++++-------- .../tests/test_table_entity_async.py | 23 +++++++++-------- .../tests/test_table_entity_cosmos.py | 19 +++++++------- .../tests/test_table_entity_cosmos_async.py | 23 +++++++++-------- 12 files changed, 93 insertions(+), 85 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py index 017ff00ba7c1..c705ff09ba93 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_batch.py @@ -480,8 +480,9 @@ def _batch_merge_entity( def delete_entity( self, - partition_key, # type: str - row_key, # type: str + entity, # type: Union[TableEntity, Mapping[str, Any]] + # partition_key, # type: str + # row_key, # type: str **kwargs # type: Any ): # type: (...) -> None @@ -504,11 +505,11 @@ def delete_entity( :dedent: 8 :caption: Creating and adding an entity to a Table """ - if self._partition_key: - if partition_key != self._partition_key: - raise ValueError("Partition Keys must all be the same") - else: - self._partition_key = partition_key + # if self._partition_key: + # if partition_key != self._partition_key: + # raise ValueError("Partition Keys must all be the same") + # else: + # self._partition_key = partition_key if_match, _ = _get_match_headers( kwargs=dict( @@ -522,12 +523,12 @@ def delete_entity( self._batch_delete_entity( table=self.table_name, - partition_key=partition_key, - row_key=row_key, + partition_key=entity["PartitionKey"], + row_key=entity["RowKey"], if_match=if_match or "*", **kwargs ) - self._entities.append(TableEntity(PartitionKey=partition_key, RowKey=row_key)) + self._entities.append(entity) def _batch_delete_entity( self, diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 02f37a2f056e..8c2dc7cd40be 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -267,8 +267,7 @@ def delete_table( @distributed_trace def delete_entity( self, - partition_key, # type: str - row_key, # type: str + entity, # type: Union[TableEntity, Dict[str, Any]] **kwargs # type: Any ): # type: (...) -> None @@ -307,8 +306,8 @@ def delete_entity( try: self._client.table.delete_entity( table=self.table_name, - partition_key=partition_key, - row_key=row_key, + partition_key=entity["PartitionKey"], + row_key=entity["RowKey"], if_match=if_match or "*", **kwargs ) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py index 8fd66c4ac148..d578f99b398a 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_batch_async.py @@ -470,8 +470,9 @@ def _batch_merge_entity( def delete_entity( self, - partition_key, # type: str - row_key, # type: str + entity, # type: Union[TableEntity, Mapping[str, Any]] + # partition_key, # type: str + # row_key, # type: str **kwargs # type: Any ): # type: (...) -> None @@ -495,11 +496,11 @@ def delete_entity( :dedent: 8 :caption: Creating and adding an entity to a Table """ - if self._partition_key: - if partition_key != self._partition_key: - raise ValueError("Partition Keys must all be the same") - else: - self._partition_key = partition_key + # if self._partition_key: + # if partition_key != self._partition_key: + # raise ValueError("Partition Keys must all be the same") + # else: + # self._partition_key = partition_key if_match, _ = _get_match_headers( kwargs=dict( @@ -513,12 +514,12 @@ def delete_entity( self._batch_delete_entity( table=self.table_name, - partition_key=partition_key, - row_key=row_key, + partition_key=entity["PartitionKey"], + row_key=entity["RowKey"], if_match=if_match or "*", **kwargs ) - self._entities.append(TableEntity(PartitionKey=partition_key, RowKey=row_key)) + self._entities.append(entity) def _batch_delete_entity( self, diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 6fb1345900e6..c4df06713600 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -278,8 +278,7 @@ async def delete_table( @distributed_trace_async async def delete_entity( self, - partition_key, # type: str - row_key, # type: str + entity, # type: Union[TableEntity, Mapping[str, Any]] **kwargs # type: Any ): # type: (...) -> None @@ -316,8 +315,8 @@ async def delete_entity( try: await self._client.table.delete_entity( table=self.table_name, - partition_key=partition_key, - row_key=row_key, + partition_key=entity["PartitionKey"], + row_key=entity["RowKey"], if_match=if_match or "*", **kwargs ) diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch.py b/sdk/tables/azure-data-tables/tests/test_table_batch.py index 204135f319d2..bc1a3f57b820 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch.py @@ -514,7 +514,7 @@ def test_batch_delete(self, tables_storage_account_name, tables_primary_storage_ assert 3 == entity.test3 batch = self.table.create_batch() - batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_result = self.table.send_batch(batch) # Assert @@ -523,7 +523,7 @@ def test_batch_delete(self, tables_storage_account_name, tables_primary_storage_ assert 'etag' not in transaction_result[0][1] with pytest.raises(ResourceNotFoundError): - entity = self.table.get_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + entity = self.table.get_entity(entity.PartitionKey, entity.RowKey) finally: self._tear_down() @@ -594,7 +594,7 @@ def test_batch_all_operations_together(self, tables_storage_account_name, tables transaction_count += 1 entity.RowKey = 'batch_all_operations_together-1' - batch.delete_entity(entity.PartitionKey, entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_count += 1 entity.RowKey = 'batch_all_operations_together-2' @@ -812,7 +812,7 @@ def test_new_delete_nonexistent_entity(self, tables_storage_account_name, tables entity = self._create_random_entity_dict('001', 'batch_negative_1') batch = self.table.create_batch() - batch.delete_entity(entity['PartitionKey'], entity['RowKey']) + batch.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) with pytest.raises(ResourceNotFoundError): resp = self.table.send_batch(batch) diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_async.py b/sdk/tables/azure-data-tables/tests/test_table_batch_async.py index aad24c21c8a9..d4ab42ee336a 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_async.py @@ -458,7 +458,7 @@ async def test_batch_delete(self, tables_storage_account_name, tables_primary_st assert 3 == entity.test3 batch = self.table.create_batch() - batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_result = await self.table.send_batch(batch) # Assert @@ -467,7 +467,7 @@ async def test_batch_delete(self, tables_storage_account_name, tables_primary_st assert 'etag' not in transaction_result[0][1] with pytest.raises(ResourceNotFoundError): - entity = await self.table.get_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + entity = await self.table.get_entity(entity.PartitionKey, entity.RowKey) finally: await self._tear_down() @@ -540,7 +540,7 @@ async def test_batch_all_operations_together(self, tables_storage_account_name, transaction_count += 1 entity.RowKey = 'batch_all_operations_together-1' - batch.delete_entity(entity.PartitionKey, entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_count += 1 entity.RowKey = 'batch_all_operations_together-2' @@ -705,7 +705,7 @@ async def test_new_delete_nonexistent_entity(self, tables_storage_account_name, entity = self._create_random_entity_dict('001', 'batch_negative_1') batch = self.table.create_batch() - batch.delete_entity(entity['PartitionKey'], entity['RowKey']) + batch.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) with pytest.raises(ResourceNotFoundError): resp = await self.table.send_batch(batch) diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py index 9fbb5cb5d3a6..fb37f693ec51 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos.py @@ -422,7 +422,7 @@ def test_batch_delete(self, tables_cosmos_account_name, tables_primary_cosmos_ac assert 3 == entity.test3 batch = self.table.create_batch() - batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_result = self.table.send_batch(batch) # Assert @@ -431,7 +431,7 @@ def test_batch_delete(self, tables_cosmos_account_name, tables_primary_cosmos_ac assert 'etag' not in transaction_result[0][1] with pytest.raises(ResourceNotFoundError): - entity = self.table.get_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + entity = self.table.get_entity(entity.PartitionKey, entity.RowKey) finally: self._tear_down() @@ -502,7 +502,7 @@ def test_batch_all_operations_together(self, tables_cosmos_account_name, tables_ transaction_count += 1 entity.RowKey = 'batch_all_operations_together-1' - batch.delete_entity(entity.PartitionKey, entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_count += 1 entity.RowKey = 'batch_all_operations_together-2' @@ -600,7 +600,7 @@ def test_new_delete_nonexistent_entity(self, tables_cosmos_account_name, tables_ entity = self._create_random_entity_dict('001', 'batch_negative_1') batch = self.table.create_batch() - batch.delete_entity(entity['PartitionKey'], entity['RowKey']) + batch.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) with pytest.raises(ResourceNotFoundError): resp = self.table.send_batch(batch) diff --git a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py index 39dfd38a3a42..1256730f9efc 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_batch_cosmos_async.py @@ -458,7 +458,7 @@ async def test_batch_delete(self, tables_cosmos_account_name, tables_primary_cos assert 3 == entity.test3 batch = self.table.create_batch() - batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_result = await self.table.send_batch(batch) # Assert @@ -467,7 +467,7 @@ async def test_batch_delete(self, tables_cosmos_account_name, tables_primary_cos assert 'etag' not in transaction_result[0][1] with pytest.raises(ResourceNotFoundError): - entity = await self.table.get_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + entity = await self.table.get_entity(entity.PartitionKey, entity.RowKey) finally: await self._tear_down() @@ -540,7 +540,7 @@ async def test_batch_all_operations_together(self, tables_cosmos_account_name, t transaction_count += 1 entity.RowKey = 'batch_all_operations_together-1' - batch.delete_entity(entity.PartitionKey, entity.RowKey) + batch.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) transaction_count += 1 entity.RowKey = 'batch_all_operations_together-2' @@ -659,7 +659,7 @@ async def test_new_delete_nonexistent_entity(self, tables_cosmos_account_name, t entity = self._create_random_entity_dict('001', 'batch_negative_1') batch = self.table.create_batch() - batch.delete_entity(entity['PartitionKey'], entity['RowKey']) + batch.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) with pytest.raises(ResourceNotFoundError): resp = await self.table.send_batch(batch) diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py index c3fe21db1a90..178e77f12887 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -313,7 +313,7 @@ def test_url_encoding_at_symbol(self, tables_storage_account_name, tables_primar assert e.RowKey == entity[u"RowKey"] assert e.Value == entity[u"Value"] count += 1 - self.table.delete_entity(e.PartitionKey, e.RowKey) + self.table.delete_entity({"PartitionKey": e.PartitionKey, "RowKey": e.RowKey}) assert count == 1 @@ -843,8 +843,7 @@ def test_get_entity_if_match(self, tables_storage_account_name, tables_primary_s row_key=entity['RowKey']) self.table.delete_entity( - partition_key=resp['PartitionKey'], - row_key=resp['RowKey'], + {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, etag=etag, match_condition=MatchConditions.IfNotModified ) @@ -1177,7 +1176,7 @@ def test_delete_entity(self, tables_storage_account_name, tables_primary_storage entity, _ = self._insert_random_entity() # Act - resp = self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + resp = self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert assert resp is None @@ -1195,7 +1194,7 @@ def test_delete_entity_not_existing(self, tables_storage_account_name, tables_pr # Act with pytest.raises(ResourceNotFoundError): - self.table.delete_entity(entity['PartitionKey'], entity['RowKey']) + self.table.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) # Assert finally: @@ -1209,8 +1208,11 @@ def test_delete_entity_with_if_matches(self, tables_storage_account_name, tables entity, etag = self._insert_random_entity() # Act - resp = self.table.delete_entity(entity.PartitionKey, entity.RowKey, etag=etag, - match_condition=MatchConditions.IfNotModified) + resp = self.table.delete_entity( + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, + etag=etag, + match_condition=MatchConditions.IfNotModified + ) # Assert assert resp is None @@ -1229,9 +1231,10 @@ def test_delete_entity_with_if_doesnt_match(self, tables_storage_account_name, t # Act with pytest.raises(HttpResponseError): self.table.delete_entity( - entity.PartitionKey, entity.RowKey, + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"', - match_condition=MatchConditions.IfNotModified) + match_condition=MatchConditions.IfNotModified + ) # Assert finally: @@ -1315,7 +1318,7 @@ def test_operations_on_entity_with_partition_key_having_single_quote(self, table assert received_entity['newField'] == 'newFieldValue' # Act - resp = self.table.delete_entity(entity.PartitionKey, entity.RowKey) + resp = self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert assert resp is None @@ -1878,7 +1881,7 @@ def test_sas_delete(self, tables_storage_account_name, tables_primary_storage_ac credential=AzureSasCredential(token), ) table = service.get_table_client(self.table_name) - table.delete_entity(entity.PartitionKey, entity.RowKey) + table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert with pytest.raises(ResourceNotFoundError): diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py index c06b901571db..1414b3a76524 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py @@ -306,7 +306,7 @@ async def test_url_encoding_at_symbol(self, tables_storage_account_name, tables_ assert e.PartitionKey == entity[u"PartitionKey"] assert e.RowKey == entity[u"RowKey"] assert e.Value == entity[u"Value"] - await self.table.delete_entity(e.PartitionKey, e.RowKey) + await self.table.delete_entity({"PartitionKey": e.PartitionKey, "RowKey": e.RowKey}) count += 1 assert count == 1 @@ -631,8 +631,7 @@ async def test_get_entity_if_match(self, tables_storage_account_name, tables_pri row_key=entity['RowKey']) await self.table.delete_entity( - partition_key=resp['PartitionKey'], - row_key=resp['RowKey'], + {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, etag=etag, match_condition=MatchConditions.IfNotModified ) @@ -967,7 +966,7 @@ async def test_delete_entity(self, tables_storage_account_name, tables_primary_s entity, _ = await self._insert_random_entity() # Act - resp = await self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + resp = await self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert assert resp is None @@ -985,7 +984,7 @@ async def test_delete_entity_not_existing(self, tables_storage_account_name, tab # Act with pytest.raises(ResourceNotFoundError): - await self.table.delete_entity(entity['PartitionKey'], entity['RowKey']) + await self.table.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) # Assert finally: @@ -999,8 +998,11 @@ async def test_delete_entity_with_if_matches(self, tables_storage_account_name, entity, etag = await self._insert_random_entity() # Act - resp = await self.table.delete_entity(entity.PartitionKey, entity.RowKey, etag=etag, - match_condition=MatchConditions.IfNotModified) + resp = await self.table.delete_entity( + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, + etag=etag, + match_condition=MatchConditions.IfNotModified + ) # Assert assert resp is None @@ -1020,9 +1022,10 @@ async def test_delete_entity_with_if_doesnt_match(self, tables_storage_account_n # Act with pytest.raises(HttpResponseError): await self.table.delete_entity( - entity.PartitionKey, entity.RowKey, + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"', - match_condition=MatchConditions.IfNotModified) + match_condition=MatchConditions.IfNotModified + ) # Assert finally: @@ -1862,7 +1865,7 @@ async def test_sas_delete(self, tables_storage_account_name, tables_primary_stor credential=AzureSasCredential(token), ) table = service.get_table_client(self.table_name) - await table.delete_entity(entity.PartitionKey, entity.RowKey) + await table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert with pytest.raises(ResourceNotFoundError): diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py index 17d122c927e5..a86f2b59f80b 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py @@ -317,7 +317,7 @@ def test_url_encoding_at_symbol(self, tables_cosmos_account_name, tables_primary assert e.RowKey == entity[u"RowKey"] assert e.Value == entity[u"Value"] count += 1 - self.table.delete_entity(e.PartitionKey, e.RowKey) + self.table.delete_entity({"PartitionKey": e.PartitionKey, "RowKey": e.RowKey}) assert count == 1 @@ -808,8 +808,7 @@ def test_get_entity_if_match(self, tables_cosmos_account_name, tables_primary_co row_key=entity['RowKey']) self.table.delete_entity( - partition_key=resp['PartitionKey'], - row_key=resp['RowKey'], + {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, etag=etag, match_condition=MatchConditions.IfNotModified ) @@ -1154,7 +1153,7 @@ def test_delete_entity(self, tables_cosmos_account_name, tables_primary_cosmos_a entity, _ = self._insert_random_entity() # Act - self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert with pytest.raises(ResourceNotFoundError): @@ -1172,7 +1171,7 @@ def test_delete_entity_not_existing(self, tables_cosmos_account_name, tables_pri # Act with pytest.raises(ResourceNotFoundError): - self.table.delete_entity(entity['PartitionKey'], entity['RowKey']) + self.table.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) # Assert finally: @@ -1188,8 +1187,7 @@ def test_delete_entity_with_if_matches(self, tables_cosmos_account_name, tables_ # Act self.table.delete_entity( - entity.PartitionKey, - entity.RowKey, + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, etag=etag, match_condition=MatchConditions.IfNotModified ) @@ -1211,9 +1209,10 @@ def test_delete_entity_with_if_doesnt_match(self, tables_cosmos_account_name, ta # Act with pytest.raises(HttpResponseError): self.table.delete_entity( - entity.PartitionKey, entity.RowKey, + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"', - match_condition=MatchConditions.IfNotModified) + match_condition=MatchConditions.IfNotModified + ) # Assert finally: @@ -1302,7 +1301,7 @@ def test_operations_on_entity_with_partition_key_having_single_quote(self, table assert received_entity['newField'] == 'newFieldValue' # Act - resp = self.table.delete_entity(entity.PartitionKey, entity.RowKey) + resp = self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) # Assert assert resp is not None diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py index e25be42641d0..6cf03ed211c9 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py @@ -307,7 +307,7 @@ async def test_url_encoding_at_symbol(self, tables_cosmos_account_name, tables_p assert e.PartitionKey == entity[u"PartitionKey"] assert e.RowKey == entity[u"RowKey"] assert e.Value == entity[u"Value"] - await self.table.delete_entity(e.PartitionKey, e.RowKey) + await self.table.delete_entity({"PartitionKey": e.PartitionKey, "RowKey": e.RowKey}) count += 1 assert count == 1 @@ -593,8 +593,7 @@ async def test_get_entity_if_match(self, tables_cosmos_account_name, tables_prim row_key=entity['RowKey']) await self.table.delete_entity( - partition_key=resp['PartitionKey'], - row_key=resp['RowKey'], + {"PartitionKey": resp['PartitionKey'], "RowKey": resp['RowKey']}, etag=etag, match_condition=MatchConditions.IfNotModified ) @@ -918,7 +917,7 @@ async def test_delete_entity(self, tables_cosmos_account_name, tables_primary_co entity, _ = await self._insert_random_entity() # Act - await self.table.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) + await self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) with pytest.raises(ResourceNotFoundError): await self.table.get_entity(entity.PartitionKey, entity.RowKey) @@ -934,7 +933,7 @@ async def test_delete_entity_not_existing(self, tables_cosmos_account_name, tabl # Act with pytest.raises(ResourceNotFoundError): - await self.table.delete_entity(entity['PartitionKey'], entity['RowKey']) + await self.table.delete_entity({"PartitionKey": entity['PartitionKey'], "RowKey": entity['RowKey']}) # Assert finally: @@ -948,8 +947,11 @@ async def test_delete_entity_with_if_matches(self, tables_cosmos_account_name, t entity, etag = await self._insert_random_entity() # Act - await self.table.delete_entity(entity.PartitionKey, entity.RowKey, etag=etag, - match_condition=MatchConditions.IfNotModified) + await self.table.delete_entity( + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, + etag=etag, + match_condition=MatchConditions.IfNotModified + ) with pytest.raises(ResourceNotFoundError): await self.table.get_entity(entity.PartitionKey, entity.RowKey) @@ -967,9 +969,10 @@ async def test_delete_entity_with_if_doesnt_match(self, tables_cosmos_account_na # Act with pytest.raises(HttpResponseError): await self.table.delete_entity( - entity.PartitionKey, entity.RowKey, + {"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}, etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"', - match_condition=MatchConditions.IfNotModified) + match_condition=MatchConditions.IfNotModified + ) # Assert finally: @@ -1055,7 +1058,7 @@ async def test_operations_on_entity_with_partition_key_having_single_quote(self, assert received_entity['newField'] == 'newFieldValue' # Act - await self.table.delete_entity(entity.PartitionKey, entity.RowKey) + await self.table.delete_entity({"PartitionKey": entity.PartitionKey, "RowKey": entity.RowKey}) finally: await self._tear_down() From e077355233f97a8b2fec38a79cf9e348950cfb4f Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 3 May 2021 11:17:23 -0400 Subject: [PATCH 2/8] added overloads to sync and async --- .../azure/data/tables/_table_client.py | 32 +- .../data/tables/aio/_table_client_async.py | 33 +- ...e_entity.test_delete_entity_overloads.yaml | 328 ++++++++++++++++++ ...ty_async.test_delete_entity_overloads.yaml | 250 +++++++++++++ ...y_cosmos.test_delete_entity_overloads.yaml | 324 +++++++++++++++++ ...os_async.test_delete_entity_overloads.yaml | 230 ++++++++++++ .../tests/test_table_entity.py | 28 ++ .../tests/test_table_entity_async.py | 28 ++ .../tests/test_table_entity_cosmos.py | 28 ++ .../tests/test_table_entity_cosmos_async.py | 29 +- 10 files changed, 1287 insertions(+), 23 deletions(-) create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 1e16f38d8fdb..c8cbcfbd7de2 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -5,7 +5,7 @@ # -------------------------------------------------------------------------- import functools -from typing import Optional, Any, Union, List, Tuple, Dict, Mapping, Iterable +from typing import Optional, Any, Union, List, Tuple, Dict, Mapping, Iterable, overload try: from urllib.parse import urlparse, unquote except ImportError: @@ -273,13 +273,19 @@ def delete_table( except HttpResponseError as error: _process_table_error(error) + @overload + def delete_entity(self, partition_key, row_key, **kwargs): + # type: (str, str, Any) -> None + ... + + @overload + def delete_entity(self, entity: Union[TableEntity, Mapping[str, Any]], **kwargs): + # type: (Union[TableEntity, Mapping[str, Any]], Any) -> None + ... + @distributed_trace - def delete_entity( - self, - entity, # type: EntityType - **kwargs # type: Any - ): - # type: (...) -> None + def delete_entity(self, *args, **kwargs): + # type: (Union[TableEntity, str], Any) -> None """Deletes the specified entity in a table. :param partition_key: The partition key of the entity. @@ -302,6 +308,14 @@ def delete_entity( :dedent: 8 :caption: Deleting an entity to a Table """ + try: + entity = kwargs.get('entity') or args[0] + partition_key = entity['PartitionKey'] + row_key = entity['RowKey'] + except TypeError: + partition_key = kwargs.get('partition_key') or args[0] + row_key = kwargs.get('row_key') or args[1] + if_match, _ = _get_match_headers( kwargs=dict( @@ -316,8 +330,8 @@ def delete_entity( try: self._client.table.delete_entity( table=self.table_name, - partition_key=entity["PartitionKey"], - row_key=entity["RowKey"], + partition_key=partition_key, + row_key=row_key, if_match=if_match or "*", **kwargs ) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 02b1882dac85..558ad7a34f43 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -4,7 +4,7 @@ # license information. # -------------------------------------------------------------------------- import functools -from typing import List, Union, Any, Optional, Mapping, Iterable, Tuple +from typing import List, Union, Any, Optional, Mapping, Iterable, Dict, overload try: from urllib.parse import urlparse, unquote except ImportError: @@ -33,11 +33,6 @@ from .._table_client import EntityType, TransactionOperationType -EntityType = Union[TableEntity, Mapping[str, Any]] -OperationType = Union[TransactionOperation, str] -TransactionOperationType = Union[Tuple[OperationType, EntityType], Tuple[OperationType, EntityType, Mapping[str, Any]]] - - class TableClient(AsyncTablesBaseClient): """ :ivar str account_name: Name of the storage account (Cosmos or Azure) @@ -269,12 +264,16 @@ async def delete_table(self, **kwargs) -> None: except HttpResponseError as error: _process_table_error(error) + @overload + async def delete_entity(self, partition_key: str, row_key: str, **kwargs: Any) -> None: + ... + + @overload + async def delete_entity(self, entity: Union[TableEntity, Mapping[str, Any]], **kwargs: Any) -> None: + ... + @distributed_trace_async - async def delete_entity( - self, - entity: EntityType, - **kwargs - ) -> None: + async def delete_entity(self, *args: Union[TableEntity, str], **kwargs: Any) -> None: """Deletes the specified entity in a table. :param partition_key: The partition key of the entity. @@ -297,6 +296,14 @@ async def delete_entity( :dedent: 8 :caption: Adding an entity to a Table """ + try: + entity = kwargs.get('entity') or args[0] + partition_key = entity['PartitionKey'] + row_key = entity['RowKey'] + except TypeError: + partition_key = kwargs.get('partition_key') or args[0] + row_key = kwargs.get('row_key') or args[1] + if_match, _ = _get_match_headers( kwargs=dict( kwargs, @@ -309,8 +316,8 @@ async def delete_entity( try: await self._client.table.delete_entity( table=self.table_name, - partition_key=entity["PartitionKey"], - row_key=entity["RowKey"], + partition_key=partition_key, + row_key=row_key, if_match=if_match or "*", **kwargs ) diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml new file mode 100644 index 000000000000..b92692dce6d7 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml @@ -0,0 +1,328 @@ +interactions: +- request: + body: '{"TableName": "uttablebdf6130e"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:39 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:39 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablebdf6130e"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 03 May 2021 15:13:30 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttablebdf6130e') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pkbdf6130e", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkbdf6130e", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:39 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:39 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A31.2726286Z''\"","PartitionKey":"pkbdf6130e","RowKey":"rkbdf6130e","Timestamp":"2021-05-03T15:13:31.2726286Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 03 May 2021 15:13:30 GMT + etag: + - W/"datetime'2021-05-03T15%3A13%3A31.2726286Z'" + location: + - https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pkbdf6130e',RowKey='rkbdf6130e') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:40 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:40 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pkbdf6130e',RowKey='rkbdf6130e') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:30 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:40 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:40 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A31.7009347Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-03T15:13:31.7009347Z","Value":100}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 03 May 2021 15:13:31 GMT + etag: + - W/"datetime'2021-05-03T15%3A13%3A31.7009347Z'" + location: + - https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pk2',RowKey='rk2') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:40 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:40 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:31 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:40 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:40 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e() + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e","value":[]}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 03 May 2021 15:13:31 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 03 May 2021 15:13:40 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:40 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttablebdf6130e') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:31 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml new file mode 100644 index 000000000000..8826bd58a1bb --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml @@ -0,0 +1,250 @@ +interactions: +- request: + body: '{"TableName": "uttable399b158b"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:41 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:41 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable399b158b"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 03 May 2021 15:13:32 GMT + location: https://fake_table_account.table.core.windows.net/Tables('uttable399b158b') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/Tables +- request: + body: '{"PartitionKey": "pk399b158b", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk399b158b", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:41 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:41 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable399b158b + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A32.9454406Z''\"","PartitionKey":"pk399b158b","RowKey":"rk399b158b","Timestamp":"2021-05-03T15:13:32.9454406Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 03 May 2021 15:13:32 GMT + etag: W/"datetime'2021-05-03T15%3A13%3A32.9454406Z'" + location: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk399b158b',RowKey='rk399b158b') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttable399b158b +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:41 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:41 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk399b158b',RowKey='rk399b158b') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Mon, 03 May 2021 15:13:33 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttable399b158b(PartitionKey='pk399b158b',RowKey='rk399b158b') +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:41 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:41 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable399b158b + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A33.2296422Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-03T15:13:33.2296422Z","Value":100}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 03 May 2021 15:13:33 GMT + etag: W/"datetime'2021-05-03T15%3A13%3A33.2296422Z'" + location: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk2',RowKey='rk2') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttable399b158b +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:41 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:41 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Mon, 03 May 2021 15:13:33 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttable399b158b(PartitionKey='pk2',RowKey='rk2') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:42 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:42 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttable399b158b() + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b","value":[]}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 03 May 2021 15:13:33 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: https://seankaneprim.table.core.windows.net/uttable399b158b() +- request: + body: null + headers: + Accept: + - application/json + Date: + - Mon, 03 May 2021 15:13:42 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:42 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttable399b158b') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Mon, 03 May 2021 15:13:33 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/Tables('uttable399b158b') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml new file mode 100644 index 000000000000..d37fc302ae31 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml @@ -0,0 +1,324 @@ +interactions: +- request: + body: '{"TableName": "uttable51021601"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:42 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:42 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable51021601","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 03 May 2021 15:13:34 GMT + etag: + - W/"datetime'2021-05-03T15%3A13%3A34.8918280Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable51021601') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "pk51021601", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk51021601", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A35.4524680Z''\"","PartitionKey":"pk51021601","RowKey":"rk51021601","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-03T15:13:35.4524680Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 03 May 2021 15:13:34 GMT + etag: + - W/"datetime'2021-05-03T15%3A13%3A35.4524680Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk51021601',RowKey='rk51021601') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk51021601',RowKey='rk51021601') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:34 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A35.7201416Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-03T15:13:35.7201416Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 03 May 2021 15:13:34 GMT + etag: + - W/"datetime'2021-05-03T15%3A13%3A35.7201416Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk2',RowKey='rk2') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:34 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601() + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttable51021601"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 03 May 2021 15:13:34 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Mon, 03 May 2021 15:13:44 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:44 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable51021601') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Mon, 03 May 2021 15:13:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:45 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:45 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 03 May 2021 15:13:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml new file mode 100644 index 000000000000..ba052698ed5c --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml @@ -0,0 +1,230 @@ +interactions: +- request: + body: '{"TableName": "uttablede4a187e"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:45 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:45 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttablede4a187e","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 03 May 2021 15:13:37 GMT + etag: W/"datetime'2021-05-03T15%3A13%3A37.5513608Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablede4a187e') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/Tables +- request: + body: '{"PartitionKey": "pkde4a187e", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkde4a187e", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:46 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:46 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A38.1186568Z''\"","PartitionKey":"pkde4a187e","RowKey":"rkde4a187e","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-03T15:13:38.1186568Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 03 May 2021 15:13:37 GMT + etag: W/"datetime'2021-05-03T15%3A13%3A38.1186568Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pkde4a187e',RowKey='rkde4a187e') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttablede4a187e +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:46 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:46 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pkde4a187e',RowKey='rkde4a187e') + response: + body: + string: '' + headers: + content-length: '0' + date: Mon, 03 May 2021 15:13:38 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pkde4a187e',RowKey='rkde4a187e') +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:47 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:47 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A38.3858184Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-03T15:13:38.3858184Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 03 May 2021 15:13:38 GMT + etag: W/"datetime'2021-05-03T15%3A13%3A38.3858184Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pk2',RowKey='rk2') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttablede4a187e +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:47 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:47 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + content-length: '0' + date: Mon, 03 May 2021 15:13:38 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pk2',RowKey='rk2') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 03 May 2021 15:13:47 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:47 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e() + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttablede4a187e"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 03 May 2021 15:13:38 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 200 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/uttablede4a187e() +- request: + body: null + headers: + Accept: + - application/json + Date: + - Mon, 03 May 2021 15:13:47 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 03 May 2021 15:13:47 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablede4a187e') + response: + body: + string: '' + headers: + content-length: '0' + date: Mon, 03 May 2021 15:13:38 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttablede4a187e') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py index 4ebf03745a6d..65baaac6678e 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -1293,6 +1293,34 @@ def test_delete_entity_with_if_doesnt_match(self, tables_storage_account_name, t finally: self._tear_down() + @TablesPreparer() + def test_delete_entity_overloads(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, _ = self._insert_random_entity() + + # Act + self.table.delete_entity(entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + self.table.create_entity(entity2) + + self.table.delete_entity(pk, rk) + + count = 0 + for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + self._tear_down() + @TablesPreparer() def test_unicode_property_value(self, tables_storage_account_name, tables_primary_storage_account_key): # Arrange diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py index ee3198237365..283a19e6c5c9 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py @@ -1027,6 +1027,34 @@ async def test_delete_entity_with_if_doesnt_match(self, tables_storage_account_n finally: await self._tear_down() + @TablesPreparer() + async def test_delete_entity_overloads(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, _ = await self._insert_random_entity() + + # Act + await self.table.delete_entity(entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + await self.table.create_entity(entity2) + + await self.table.delete_entity(pk, rk) + + count = 0 + async for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + await self._tear_down() + @TablesPreparer() async def test_unicode_property_value(self, tables_storage_account_name, tables_primary_storage_account_key): ''' regression test for github issue #57''' diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py index 70ccf52c68b2..ee1460a5754f 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py @@ -1267,6 +1267,34 @@ def test_delete_entity_with_if_doesnt_match(self, tables_cosmos_account_name, ta self._tear_down() self.sleep(SLEEP_DELAY) + @CosmosPreparer() + def test_delete_entity_overloads(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, _ = self._insert_random_entity() + + # Act + self.table.delete_entity(entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + self.table.create_entity(entity2) + + self.table.delete_entity(pk, rk) + + count = 0 + for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + self._tear_down() + @CosmosPreparer() def test_unicode_property_value(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): # Arrange diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py index 462a8b1fa0ed..51a1e2927437 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py @@ -973,8 +973,35 @@ async def test_delete_entity_with_if_doesnt_match(self, tables_cosmos_account_na etag=u'W/"datetime\'2012-06-15T22%3A51%3A44.9662825Z\'"', match_condition=MatchConditions.IfNotModified ) + finally: + await self._tear_down() - # Assert + @CosmosPreparer() + async def test_delete_entity_overloads(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, _ = await self._insert_random_entity() + + # Test passing in an entity + await self.table.delete_entity(entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + await self.table.create_entity(entity2) + + # Test passing in a partition key and row key + await self.table.delete_entity(pk, rk) + + count = 0 + async for entity in self.table.list_entities(): + count += 1 + assert count == 0 finally: await self._tear_down() From 3d8dec9934da2af3b4f872eb823458dc3e626f3b Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 3 May 2021 11:23:38 -0400 Subject: [PATCH 3/8] removed import --- .../azure/data/tables/aio/_table_client_async.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 558ad7a34f43..488499c77285 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -24,7 +24,7 @@ from .._serialize import serialize_iso, _parameter_filter_substitution from .._deserialize import _return_headers_and_deserialized from .._error import _process_table_error, _validate_table_name -from .._models import UpdateMode, TransactionOperation +from .._models import UpdateMode from .._deserialize import _convert_to_entity, _trim_service_metadata from .._serialize import _add_entity_properties, _get_match_headers from ._base_client_async import AsyncTablesBaseClient From feb49035de90657b853a5b329982ef7ac15fe601 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Mon, 3 May 2021 12:30:41 -0400 Subject: [PATCH 4/8] have to use pass instead of ... --- .../azure-data-tables/azure/data/tables/_table_client.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index c8cbcfbd7de2..9559b95457f9 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -276,12 +276,12 @@ def delete_table( @overload def delete_entity(self, partition_key, row_key, **kwargs): # type: (str, str, Any) -> None - ... + pass @overload - def delete_entity(self, entity: Union[TableEntity, Mapping[str, Any]], **kwargs): + def delete_entity(self, entity, **kwargs): # type: (Union[TableEntity, Mapping[str, Any]], Any) -> None - ... + pass @distributed_trace def delete_entity(self, *args, **kwargs): From bc123c7771b5b4d239b44b3a3139b55cc530d808 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 4 May 2021 15:45:41 -0400 Subject: [PATCH 5/8] adding tests for delete_entity passed in as kwargs --- .../azure/data/tables/_table_client.py | 14 +- .../data/tables/aio/_table_client_async.py | 14 +- ...e_entity.test_delete_entity_overloads.yaml | 50 +-- ...y.test_delete_entity_overloads_kwargs.yaml | 328 ++++++++++++++++++ ...ty_async.test_delete_entity_overloads.yaml | 50 +-- ...c.test_delete_entity_overloads_kwargs.yaml | 250 +++++++++++++ ...y_cosmos.test_delete_entity_overloads.yaml | 58 ++-- ...s.test_delete_entity_overloads_kwargs.yaml | 324 +++++++++++++++++ ...os_async.test_delete_entity_overloads.yaml | 52 +-- ...c.test_delete_entity_overloads_kwargs.yaml | 230 ++++++++++++ .../tests/test_table_entity.py | 28 ++ .../tests/test_table_entity_async.py | 28 ++ .../tests/test_table_entity_cosmos.py | 28 ++ .../tests/test_table_entity_cosmos_async.py | 29 ++ 14 files changed, 1370 insertions(+), 113 deletions(-) create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads_kwargs.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads_kwargs.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads_kwargs.yaml create mode 100644 sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads_kwargs.yaml diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 9559b95457f9..130fba856bbb 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -309,12 +309,18 @@ def delete_entity(self, *args, **kwargs): :caption: Deleting an entity to a Table """ try: - entity = kwargs.get('entity') or args[0] + entity = kwargs.pop('entity', None) + if not entity: + entity = args[0] partition_key = entity['PartitionKey'] row_key = entity['RowKey'] - except TypeError: - partition_key = kwargs.get('partition_key') or args[0] - row_key = kwargs.get('row_key') or args[1] + except (TypeError, IndexError): # IndexError for if they send via pk, rk + partition_key = kwargs.pop('partition_key', None) + if not partition_key: + partition_key = args[0] + row_key = kwargs.pop('row_key', None) or args[1] + if not row_key: + row_key = args[1] if_match, _ = _get_match_headers( diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 488499c77285..6531983d23b7 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -297,12 +297,18 @@ async def delete_entity(self, *args: Union[TableEntity, str], **kwargs: Any) -> :caption: Adding an entity to a Table """ try: - entity = kwargs.get('entity') or args[0] + entity = kwargs.pop('entity', None) + if not entity: + entity = args[0] partition_key = entity['PartitionKey'] row_key = entity['RowKey'] - except TypeError: - partition_key = kwargs.get('partition_key') or args[0] - row_key = kwargs.get('row_key') or args[1] + except (TypeError, IndexError): # IndexError for if they send via pk, rk + partition_key = kwargs.pop('partition_key', None) + if not partition_key: + partition_key = args[0] + row_key = kwargs.pop('row_key', None) or args[1] + if not row_key: + row_key = args[1] if_match, _ = _get_match_headers( kwargs=dict( diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml index b92692dce6d7..3de0f20f8285 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:39 GMT + - Tue, 04 May 2021 19:45:04 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:39 GMT + - Tue, 04 May 2021 19:45:04 GMT x-ms-version: - '2019-02-02' method: POST @@ -33,7 +33,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Mon, 03 May 2021 15:13:30 GMT + - Tue, 04 May 2021 19:45:04 GMT location: - https://fake_table_account.table.core.windows.net/Tables('uttablebdf6130e') server: @@ -70,27 +70,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:39 GMT + - Tue, 04 May 2021 19:45:04 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:39 GMT + - Tue, 04 May 2021 19:45:04 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A31.2726286Z''\"","PartitionKey":"pkbdf6130e","RowKey":"rkbdf6130e","Timestamp":"2021-05-03T15:13:31.2726286Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A45%3A05.1450594Z''\"","PartitionKey":"pkbdf6130e","RowKey":"rkbdf6130e","Timestamp":"2021-05-04T19:45:05.1450594Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Mon, 03 May 2021 15:13:30 GMT + - Tue, 04 May 2021 19:45:04 GMT etag: - - W/"datetime'2021-05-03T15%3A13%3A31.2726286Z'" + - W/"datetime'2021-05-04T19%3A45%3A05.1450594Z'" location: - https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pkbdf6130e',RowKey='rkbdf6130e') server: @@ -118,13 +118,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -138,7 +138,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:30 GMT + - Tue, 04 May 2021 19:45:04 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: @@ -165,27 +165,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttablebdf6130e response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A31.7009347Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-03T15:13:31.7009347Z","Value":100}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablebdf6130e/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A45%3A05.4472729Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-04T19:45:05.4472729Z","Value":100}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Mon, 03 May 2021 15:13:31 GMT + - Tue, 04 May 2021 19:45:04 GMT etag: - - W/"datetime'2021-05-03T15%3A13%3A31.7009347Z'" + - W/"datetime'2021-05-04T19%3A45%3A05.4472729Z'" location: - https://fake_table_account.table.core.windows.net/uttablebdf6130e(PartitionKey='pk2',RowKey='rk2') server: @@ -213,13 +213,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -233,7 +233,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:31 GMT + - Tue, 04 May 2021 19:45:04 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: @@ -255,11 +255,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT x-ms-version: - '2019-02-02' method: GET @@ -273,7 +273,7 @@ interactions: content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Mon, 03 May 2021 15:13:31 GMT + - Tue, 04 May 2021 19:45:05 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -297,11 +297,11 @@ interactions: Content-Length: - '0' Date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:40 GMT + - Tue, 04 May 2021 19:45:05 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -315,7 +315,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:31 GMT + - Tue, 04 May 2021 19:45:05 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads_kwargs.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads_kwargs.yaml new file mode 100644 index 000000000000..cbadd882a8f1 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_delete_entity_overloads_kwargs.yaml @@ -0,0 +1,328 @@ +interactions: +- request: + body: '{"TableName": "uttable4ef015fc"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:05 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:05 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttable4ef015fc"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 04 May 2021 19:45:05 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttable4ef015fc') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: '{"PartitionKey": "pk4ef015fc", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk4ef015fc", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:06 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable4ef015fc + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable4ef015fc/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A45%3A06.5367606Z''\"","PartitionKey":"pk4ef015fc","RowKey":"rk4ef015fc","Timestamp":"2021-05-04T19:45:06.5367606Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 04 May 2021 19:45:05 GMT + etag: + - W/"datetime'2021-05-04T19%3A45%3A06.5367606Z'" + location: + - https://fake_table_account.table.core.windows.net/uttable4ef015fc(PartitionKey='pk4ef015fc',RowKey='rk4ef015fc') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:06 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:06 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable4ef015fc(PartitionKey='pk4ef015fc',RowKey='rk4ef015fc') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 04 May 2021 19:45:06 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:06 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable4ef015fc + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable4ef015fc/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A45%3A06.8399788Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-04T19:45:06.8399788Z","Value":100}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 04 May 2021 19:45:06 GMT + etag: + - W/"datetime'2021-05-04T19%3A45%3A06.8399788Z'" + location: + - https://fake_table_account.table.core.windows.net/uttable4ef015fc(PartitionKey='pk2',RowKey='rk2') + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:06 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:06 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttable4ef015fc(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 04 May 2021 19:45:06 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:45:06 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:06 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttable4ef015fc() + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable4ef015fc","value":[]}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Tue, 04 May 2021 19:45:06 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 200 + message: OK +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 04 May 2021 19:45:07 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:45:07 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttable4ef015fc') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Tue, 04 May 2021 19:45:06 GMT + server: + - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: + - nosniff + x-ms-version: + - '2019-02-02' + status: + code: 204 + message: No Content +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml index 8826bd58a1bb..20384c0b42b2 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT x-ms-version: - '2019-02-02' method: POST @@ -26,7 +26,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Mon, 03 May 2021 15:13:32 GMT + date: Tue, 04 May 2021 19:43:29 GMT location: https://fake_table_account.table.core.windows.net/Tables('uttable399b158b') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -55,23 +55,23 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable399b158b response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A32.9454406Z''\"","PartitionKey":"pk399b158b","RowKey":"rk399b158b","Timestamp":"2021-05-03T15:13:32.9454406Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A30.6953206Z''\"","PartitionKey":"pk399b158b","RowKey":"rk399b158b","Timestamp":"2021-05-04T19:43:30.6953206Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Mon, 03 May 2021 15:13:32 GMT - etag: W/"datetime'2021-05-03T15%3A13%3A32.9454406Z'" + date: Tue, 04 May 2021 19:43:29 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A30.6953206Z'" location: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk399b158b',RowKey='rk399b158b') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -89,13 +89,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -106,7 +106,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Mon, 03 May 2021 15:13:33 GMT + date: Tue, 04 May 2021 19:43:29 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' @@ -127,23 +127,23 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable399b158b response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A33.2296422Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-03T15:13:33.2296422Z","Value":100}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable399b158b/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A30.9174802Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-04T19:43:30.9174802Z","Value":100}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Mon, 03 May 2021 15:13:33 GMT - etag: W/"datetime'2021-05-03T15%3A13%3A33.2296422Z'" + date: Tue, 04 May 2021 19:43:29 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A30.9174802Z'" location: https://fake_table_account.table.core.windows.net/uttable399b158b(PartitionKey='pk2',RowKey='rk2') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -161,13 +161,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:41 GMT + - Tue, 04 May 2021 19:43:30 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -178,7 +178,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Mon, 03 May 2021 15:13:33 GMT + date: Tue, 04 May 2021 19:43:30 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' @@ -194,11 +194,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:31 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:31 GMT x-ms-version: - '2019-02-02' method: GET @@ -209,7 +209,7 @@ interactions: headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Mon, 03 May 2021 15:13:33 GMT + date: Tue, 04 May 2021 19:43:30 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff @@ -224,11 +224,11 @@ interactions: Accept: - application/json Date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:31 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:31 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -239,7 +239,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Mon, 03 May 2021 15:13:33 GMT + date: Tue, 04 May 2021 19:43:30 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 x-content-type-options: nosniff x-ms-version: '2019-02-02' diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads_kwargs.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads_kwargs.yaml new file mode 100644 index 000000000000..3b290223effd --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_delete_entity_overloads_kwargs.yaml @@ -0,0 +1,250 @@ +interactions: +- request: + body: '{"TableName": "uttabledbf11879"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:31 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:31 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/Tables + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttabledbf11879"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Tue, 04 May 2021 19:43:31 GMT + location: https://fake_table_account.table.core.windows.net/Tables('uttabledbf11879') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/Tables +- request: + body: '{"PartitionKey": "pkdbf11879", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkdbf11879", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:31 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:31 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttabledbf11879 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttabledbf11879/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A31.8443953Z''\"","PartitionKey":"pkdbf11879","RowKey":"rkdbf11879","Timestamp":"2021-05-04T19:43:31.8443953Z","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Tue, 04 May 2021 19:43:31 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A31.8443953Z'" + location: https://fake_table_account.table.core.windows.net/uttabledbf11879(PartitionKey='pkdbf11879',RowKey='rkdbf11879') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttabledbf11879 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:31 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:31 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttabledbf11879(PartitionKey='pkdbf11879',RowKey='rkdbf11879') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Tue, 04 May 2021 19:43:31 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttabledbf11879(PartitionKey='pkdbf11879',RowKey='rkdbf11879') +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:31 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:31 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttabledbf11879 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttabledbf11879/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A32.0635526Z''\"","PartitionKey":"pk2","RowKey":"rk2","Timestamp":"2021-05-04T19:43:32.0635526Z","Value":100}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Tue, 04 May 2021 19:43:32 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A32.0635526Z'" + location: https://fake_table_account.table.core.windows.net/uttabledbf11879(PartitionKey='pk2',RowKey='rk2') + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 201 + message: Created + url: https://seankaneprim.table.core.windows.net/uttabledbf11879 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:32 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:32 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/uttabledbf11879(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Tue, 04 May 2021 19:43:32 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/uttabledbf11879(PartitionKey='pk2',RowKey='rk2') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:32 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:32 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttabledbf11879() + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttabledbf11879","value":[]}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Tue, 04 May 2021 19:43:32 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 200 + message: OK + url: https://seankaneprim.table.core.windows.net/uttabledbf11879() +- request: + body: null + headers: + Accept: + - application/json + Date: + - Tue, 04 May 2021 19:43:32 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:32 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttabledbf11879') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Tue, 04 May 2021 19:43:32 GMT + server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 + x-content-type-options: nosniff + x-ms-version: '2019-02-02' + status: + code: 204 + message: No Content + url: https://seankaneprim.table.core.windows.net/Tables('uttabledbf11879') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml index d37fc302ae31..55ea9611d627 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:32 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:42 GMT + - Tue, 04 May 2021 19:43:32 GMT x-ms-version: - '2019-02-02' method: POST @@ -31,9 +31,9 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT etag: - - W/"datetime'2021-05-03T15%3A13%3A34.8918280Z'" + - W/"datetime'2021-05-04T19%3A43%3A33.4303752Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable51021601') server: @@ -66,25 +66,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:33 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:33 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601 response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A35.4524680Z''\"","PartitionKey":"pk51021601","RowKey":"rk51021601","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-03T15:13:35.4524680Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A34.1011976Z''\"","PartitionKey":"pk51021601","RowKey":"rk51021601","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-04T19:43:34.1011976Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT etag: - - W/"datetime'2021-05-03T15%3A13%3A35.4524680Z'" + - W/"datetime'2021-05-04T19%3A43%3A34.1011976Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk51021601',RowKey='rk51021601') server: @@ -108,13 +108,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -126,7 +126,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -149,25 +149,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601 response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A35.7201416Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-03T15:13:35.7201416Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601/$metadata#uttable51021601/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A34.3622152Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-04T19:43:34.3622152Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT etag: - - W/"datetime'2021-05-03T15%3A13%3A35.7201416Z'" + - W/"datetime'2021-05-04T19%3A43%3A34.3622152Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/uttable51021601(PartitionKey='pk2',RowKey='rk2') server: @@ -191,13 +191,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -209,7 +209,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -227,11 +227,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT x-ms-version: - '2019-02-02' method: GET @@ -243,7 +243,7 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Mon, 03 May 2021 15:13:34 GMT + - Tue, 04 May 2021 19:43:33 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -263,11 +263,11 @@ interactions: Content-Length: - '0' Date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:44 GMT + - Tue, 04 May 2021 19:43:34 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -279,7 +279,7 @@ interactions: content-length: - '0' date: - - Mon, 03 May 2021 15:13:36 GMT + - Tue, 04 May 2021 19:43:34 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -297,11 +297,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:45 GMT + - Tue, 04 May 2021 19:43:35 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:45 GMT + - Tue, 04 May 2021 19:43:35 GMT x-ms-version: - '2019-02-02' method: GET @@ -313,7 +313,7 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Mon, 03 May 2021 15:13:36 GMT + - Tue, 04 May 2021 19:43:34 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads_kwargs.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads_kwargs.yaml new file mode 100644 index 000000000000..1527a6f84172 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_delete_entity_overloads_kwargs.yaml @@ -0,0 +1,324 @@ +interactions: +- request: + body: '{"TableName": "uttablef69218ef"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:35 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:35 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttablef69218ef","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Tue, 04 May 2021 19:43:36 GMT + etag: + - W/"datetime'2021-05-04T19%3A43%3A36.0299016Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablef69218ef') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "pkf69218ef", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkf69218ef", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:36 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef/$metadata#uttablef69218ef/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A36.6675464Z''\"","PartitionKey":"pkf69218ef","RowKey":"rkf69218ef","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-04T19:43:36.6675464Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Tue, 04 May 2021 19:43:36 GMT + etag: + - W/"datetime'2021-05-04T19%3A43%3A36.6675464Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef(PartitionKey='pkf69218ef',RowKey='rkf69218ef') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:36 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:36 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef(PartitionKey='pkf69218ef',RowKey='rkf69218ef') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 04 May 2021 19:43:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:36 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef/$metadata#uttablef69218ef/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A36.9239560Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-04T19:43:36.9239560Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Tue, 04 May 2021 19:43:36 GMT + etag: + - W/"datetime'2021-05-04T19%3A43%3A36.9239560Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef(PartitionKey='pk2',RowKey='rk2') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Created +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:36 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:36 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 04 May 2021 19:43:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:37 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablef69218ef() + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttablef69218ef"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Tue, 04 May 2021 19:43:36 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +- request: + body: null + headers: + Accept: + - application/json + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '0' + Date: + - Tue, 04 May 2021 19:43:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:37 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablef69218ef') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Tue, 04 May 2021 19:43:37 GMT + server: + - Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:43:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:43:37 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Tue, 04 May 2021 19:43:37 GMT + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 200 + message: Ok +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml index ba052698ed5c..51497bfdb4f9 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:45 GMT + - Tue, 04 May 2021 19:43:37 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:45 GMT + - Tue, 04 May 2021 19:43:37 GMT x-ms-version: - '2019-02-02' method: POST @@ -25,8 +25,8 @@ interactions: string: '{"TableName":"uttablede4a187e","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' headers: content-type: application/json;odata=minimalmetadata - date: Mon, 03 May 2021 15:13:37 GMT - etag: W/"datetime'2021-05-03T15%3A13%3A37.5513608Z'" + date: Tue, 04 May 2021 19:43:38 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A38.3982088Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablede4a187e') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -53,22 +53,22 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:46 GMT + - Tue, 04 May 2021 19:43:38 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:46 GMT + - Tue, 04 May 2021 19:43:38 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A38.1186568Z''\"","PartitionKey":"pkde4a187e","RowKey":"rkde4a187e","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-03T15:13:38.1186568Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A38.9327368Z''\"","PartitionKey":"pkde4a187e","RowKey":"rkde4a187e","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-04T19:43:38.9327368Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Mon, 03 May 2021 15:13:37 GMT - etag: W/"datetime'2021-05-03T15%3A13%3A38.1186568Z'" + date: Tue, 04 May 2021 19:43:38 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A38.9327368Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pkde4a187e',RowKey='rkde4a187e') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -84,13 +84,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:46 GMT + - Tue, 04 May 2021 19:43:38 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:46 GMT + - Tue, 04 May 2021 19:43:38 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -100,7 +100,7 @@ interactions: string: '' headers: content-length: '0' - date: Mon, 03 May 2021 15:13:38 GMT + date: Tue, 04 May 2021 19:43:38 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 @@ -119,22 +119,22 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-03T15%3A13%3A38.3858184Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-03T15:13:38.3858184Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e/$metadata#uttablede4a187e/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A43%3A39.2325640Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-04T19:43:39.2325640Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Mon, 03 May 2021 15:13:38 GMT - etag: W/"datetime'2021-05-03T15%3A13%3A38.3858184Z'" + date: Tue, 04 May 2021 19:43:38 GMT + etag: W/"datetime'2021-05-04T19%3A43%3A39.2325640Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/uttablede4a187e(PartitionKey='pk2',RowKey='rk2') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -150,13 +150,13 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT If-Match: - '*' User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -166,7 +166,7 @@ interactions: string: '' headers: content-length: '0' - date: Mon, 03 May 2021 15:13:38 GMT + date: Tue, 04 May 2021 19:43:38 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 @@ -180,11 +180,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT x-ms-version: - '2019-02-02' method: GET @@ -194,7 +194,7 @@ interactions: string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttablede4a187e"}' headers: content-type: application/json;odata=minimalmetadata - date: Mon, 03 May 2021 15:13:38 GMT + date: Tue, 04 May 2021 19:43:38 GMT server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked status: @@ -207,11 +207,11 @@ interactions: Accept: - application/json Date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT User-Agent: - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Mon, 03 May 2021 15:13:47 GMT + - Tue, 04 May 2021 19:43:39 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -221,7 +221,7 @@ interactions: string: '' headers: content-length: '0' - date: Mon, 03 May 2021 15:13:38 GMT + date: Tue, 04 May 2021 19:43:39 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads_kwargs.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads_kwargs.yaml new file mode 100644 index 000000000000..12325354ec12 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_delete_entity_overloads_kwargs.yaml @@ -0,0 +1,230 @@ +interactions: +- request: + body: '{"TableName": "uttable95541b6c"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:09 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:09 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable95541b6c","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Tue, 04 May 2021 19:44:10 GMT + etag: W/"datetime'2021-05-04T19%3A44%3A10.8103688Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable95541b6c') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/Tables +- request: + body: '{"PartitionKey": "pk95541b6c", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk95541b6c", "RowKey@odata.type": "Edm.String", "age": 39, "sex": + "male", "sex@odata.type": "Edm.String", "married": true, "deceased": false, + "ratio": 3.1, "evenratio": 3.0, "large": 933311100, "Birthday": "1973-10-04T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5", "binary@odata.type": + "Edm.Binary", "other": 20, "clsid": "c9da6455-213d-42c9-9a79-3e9149a57833", + "clsid@odata.type": "Edm.Guid"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '591' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c/$metadata#uttable95541b6c/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A44%3A11.3381384Z''\"","PartitionKey":"pk95541b6c","RowKey":"rk95541b6c","age":39,"sex":"male","married":true,"deceased":false,"ratio":3.1,"evenratio":3.0,"large":933311100,"Birthday@odata.type":"Edm.DateTime","Birthday":"1973-10-04T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1970-10-04T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5","other":20,"clsid@odata.type":"Edm.Guid","clsid":"c9da6455-213d-42c9-9a79-3e9149a57833","Timestamp":"2021-05-04T19:44:11.3381384Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Tue, 04 May 2021 19:44:10 GMT + etag: W/"datetime'2021-05-04T19%3A44%3A11.3381384Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk95541b6c',RowKey='rk95541b6c') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttable95541b6c +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:11 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk95541b6c',RowKey='rk95541b6c') + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 04 May 2021 19:44:10 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk95541b6c',RowKey='rk95541b6c') +- request: + body: '{"PartitionKey": "pk2", "PartitionKey@odata.type": "Edm.String", "RowKey": + "rk2", "RowKey@odata.type": "Edm.String", "Value": 100}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '130' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c/$metadata#uttable95541b6c/@Element","odata.etag":"W/\"datetime''2021-05-04T19%3A44%3A11.5628040Z''\"","PartitionKey":"pk2","RowKey":"rk2","Value":100,"Timestamp":"2021-05-04T19:44:11.5628040Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Tue, 04 May 2021 19:44:10 GMT + etag: W/"datetime'2021-05-04T19%3A44%3A11.5628040Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk2',RowKey='rk2') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttable95541b6c +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:11 GMT + If-Match: + - '*' + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk2',RowKey='rk2') + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 04 May 2021 19:44:10 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/uttable95541b6c(PartitionKey='pk2',RowKey='rk2') +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Tue, 04 May 2021 19:44:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable95541b6c() + response: + body: + string: '{"value":[],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttable95541b6c"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Tue, 04 May 2021 19:44:10 GMT + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 200 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/uttable95541b6c() +- request: + body: null + headers: + Accept: + - application/json + Date: + - Tue, 04 May 2021 19:44:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b7 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Tue, 04 May 2021 19:44:11 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable95541b6c') + response: + body: + string: '' + headers: + content-length: '0' + date: Tue, 04 May 2021 19:44:12 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttable95541b6c') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity.py b/sdk/tables/azure-data-tables/tests/test_table_entity.py index 65baaac6678e..71fe036d7849 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -1321,6 +1321,34 @@ def test_delete_entity_overloads(self, tables_storage_account_name, tables_prima finally: self._tear_down() + @TablesPreparer() + def test_delete_entity_overloads_kwargs(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, _ = self._insert_random_entity() + + # Act + self.table.delete_entity(entity=entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + self.table.create_entity(entity2) + + self.table.delete_entity(partition_key=pk, row_key=rk) + + count = 0 + for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + self._tear_down() + @TablesPreparer() def test_unicode_property_value(self, tables_storage_account_name, tables_primary_storage_account_key): # Arrange diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py index 283a19e6c5c9..05a54085f038 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py @@ -1055,6 +1055,34 @@ async def test_delete_entity_overloads(self, tables_storage_account_name, tables finally: await self._tear_down() + @TablesPreparer() + async def test_delete_entity_overloads_kwargs(self, tables_storage_account_name, tables_primary_storage_account_key): + # Arrange + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity, _ = await self._insert_random_entity() + + # Act + await self.table.delete_entity(entity=entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + await self.table.create_entity(entity2) + + await self.table.delete_entity(partition_key=pk, row_key=rk) + + count = 0 + async for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + await self._tear_down() + @TablesPreparer() async def test_unicode_property_value(self, tables_storage_account_name, tables_primary_storage_account_key): ''' regression test for github issue #57''' diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py index ee1460a5754f..6899d4c53bb2 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos.py @@ -1295,6 +1295,34 @@ def test_delete_entity_overloads(self, tables_cosmos_account_name, tables_primar finally: self._tear_down() + @CosmosPreparer() + def test_delete_entity_overloads_kwargs(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, _ = self._insert_random_entity() + + # Act + self.table.delete_entity(entity=entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + self.table.create_entity(entity2) + + self.table.delete_entity(partition_key=pk, row_key=rk) + + count = 0 + for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + self._tear_down() + @CosmosPreparer() def test_unicode_property_value(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): # Arrange diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py index 51a1e2927437..45185d3c03fc 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py @@ -1005,6 +1005,35 @@ async def test_delete_entity_overloads(self, tables_cosmos_account_name, tables_ finally: await self._tear_down() + @CosmosPreparer() + async def test_delete_entity_overloads_kwargs(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # Arrange + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity, _ = await self._insert_random_entity() + + # Test passing in an entity + await self.table.delete_entity(entity=entity) + + pk, rk = self._create_pk_rk("pk", "rk") + pk, rk = pk + u"2", rk + u"2" + entity2 = { + u"PartitionKey": pk, + u"RowKey": rk, + u"Value": 100 + } + await self.table.create_entity(entity2) + + # Test passing in a partition key and row key + await self.table.delete_entity(partition_key=pk, row_key=rk) + + count = 0 + async for entity in self.table.list_entities(): + count += 1 + assert count == 0 + finally: + await self._tear_down() + @CosmosPreparer() async def test_unicode_property_value(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): ''' regression test for github issue #57''' From 186480b9e1ab2cf80813b2eedab7de8509ee3f39 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Tue, 4 May 2021 15:46:41 -0400 Subject: [PATCH 6/8] removing a note --- sdk/tables/azure-data-tables/azure/data/tables/_table_client.py | 2 +- .../azure/data/tables/aio/_table_client_async.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 130fba856bbb..358a91881c94 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -314,7 +314,7 @@ def delete_entity(self, *args, **kwargs): entity = args[0] partition_key = entity['PartitionKey'] row_key = entity['RowKey'] - except (TypeError, IndexError): # IndexError for if they send via pk, rk + except (TypeError, IndexError): partition_key = kwargs.pop('partition_key', None) if not partition_key: partition_key = args[0] diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 6531983d23b7..6c3175a38e29 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -302,7 +302,7 @@ async def delete_entity(self, *args: Union[TableEntity, str], **kwargs: Any) -> entity = args[0] partition_key = entity['PartitionKey'] row_key = entity['RowKey'] - except (TypeError, IndexError): # IndexError for if they send via pk, rk + except (TypeError, IndexError): partition_key = kwargs.pop('partition_key', None) if not partition_key: partition_key = args[0] From 2ad3b63add9517d9691d9a60769b05dcebb05610 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 4 May 2021 16:36:08 -0400 Subject: [PATCH 7/8] Update sdk/tables/azure-data-tables/azure/data/tables/_table_client.py --- sdk/tables/azure-data-tables/azure/data/tables/_table_client.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py index 358a91881c94..fe3b62db99d7 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_table_client.py @@ -318,7 +318,7 @@ def delete_entity(self, *args, **kwargs): partition_key = kwargs.pop('partition_key', None) if not partition_key: partition_key = args[0] - row_key = kwargs.pop('row_key', None) or args[1] + row_key = kwargs.pop("row_key", None) if not row_key: row_key = args[1] From 2d003d67889e9db9a044d05c59969009b8b95553 Mon Sep 17 00:00:00 2001 From: seankane-msft Date: Wed, 5 May 2021 10:26:09 -0400 Subject: [PATCH 8/8] fixing async client, and two missing awaits --- .../azure/data/tables/aio/_table_client_async.py | 2 +- sdk/tables/azure-data-tables/tests/test_table_entity_async.py | 2 +- .../azure-data-tables/tests/test_table_entity_cosmos_async.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py index 6c3175a38e29..4e27e37b16c9 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/aio/_table_client_async.py @@ -306,7 +306,7 @@ async def delete_entity(self, *args: Union[TableEntity, str], **kwargs: Any) -> partition_key = kwargs.pop('partition_key', None) if not partition_key: partition_key = args[0] - row_key = kwargs.pop('row_key', None) or args[1] + row_key = kwargs.pop("row_key", None) if not row_key: row_key = args[1] diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py index 05a54085f038..9abab49a890d 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_async.py @@ -1571,7 +1571,7 @@ async def test_query_user_filter_binary(self, tables_storage_account_name, table assert length == 1 finally: - self._tear_down() + await self._tear_down() @TablesPreparer() async def test_query_user_filter_int64(self, tables_storage_account_name, tables_primary_storage_account_key): diff --git a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py index 45185d3c03fc..c9a2d11e56b1 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity_cosmos_async.py @@ -1433,7 +1433,7 @@ async def test_query_user_filter_binary(self, tables_cosmos_account_name, tables assert length == 1 finally: - self._tear_down() + await self._tear_down() @CosmosPreparer() async def test_query_user_filter_int64(self, tables_cosmos_account_name, tables_primary_cosmos_account_key):