From 2e816da47e258923784330084bb4da0793be5643 Mon Sep 17 00:00:00 2001 From: Sean Kane <68240067+seankane-msft@users.noreply.github.com> Date: Tue, 3 Nov 2020 09:59:38 -0800 Subject: [PATCH] String unicode deserial (#14958) --- ..._insert_entity_with_large_int_success.yaml | 82 ++++++++-------- ..._insert_entity_with_large_int_success.yaml | 94 +++++++++---------- .../tests/test_table_async.py | 4 +- .../tests/test_table_batch_cosmos.py | 22 ++--- .../tests/test_table_batch_cosmos_async.py | 29 +++--- .../tests/test_table_entity.py | 2 +- .../tests/test_table_entity_cosmos.py | 2 +- 7 files changed, 119 insertions(+), 116 deletions(-) diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int_success.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int_success.yaml index 364fd25c4845..d7e95314d74e 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int_success.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_insert_entity_with_large_int_success.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"TableName": "uttablede991889"}' + body: !!python/unicode '{"TableName": "uttablede991889"}' headers: Accept: - application/json;odata=minimalmetadata @@ -15,25 +15,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:39:10 GMT + - Mon, 02 Nov 2020 20:02:09 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:10 GMT + - Mon, 02 Nov 2020 20:02:09 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablesteststorname.table.core.windows.net/Tables response: body: - string: '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablede991889"}' + string: !!python/unicode '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#Tables/@Element","TableName":"uttablede991889"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 28 Oct 2020 21:39:11 GMT + - Mon, 02 Nov 2020 20:02:09 GMT location: - https://tablesteststorname.table.core.windows.net/Tables('uttablede991889') server: @@ -48,9 +48,9 @@ interactions: code: 201 message: Created - request: - body: '{"PartitionKey": "pkde991889", "PartitionKey@odata.type": "Edm.String", - "RowKey": "rkde991889", "RowKey@odata.type": "Edm.String", "large": "1125899906842624", - "large@odata.type": "Edm.Int64"}' + body: !!python/unicode '{"large": "1125899906842624", "RowKey@odata.type": "Edm.String", + "PartitionKey@odata.type": "Edm.String", "large@odata.type": "Edm.Int64", "PartitionKey": + "pkde991889", "RowKey": "rkde991889"}' headers: Accept: - application/json;odata=minimalmetadata @@ -65,27 +65,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablesteststorname.table.core.windows.net/uttablede991889 response: body: - string: '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A39%3A12.0811252Z''\"","PartitionKey":"pkde991889","RowKey":"rkde991889","Timestamp":"2020-10-28T21:39:12.0811252Z","large@odata.type":"Edm.Int64","large":"1125899906842624"}' + string: !!python/unicode '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A02%3A10.3515865Z''\"","PartitionKey":"pkde991889","RowKey":"rkde991889","Timestamp":"2020-11-02T20:02:10.3515865Z","large@odata.type":"Edm.Int64","large":"1125899906842624"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 28 Oct 2020 21:39:11 GMT + - Mon, 02 Nov 2020 20:02:09 GMT etag: - - W/"datetime'2020-10-28T21%3A39%3A12.0811252Z'" + - W/"datetime'2020-11-02T20%3A02%3A10.3515865Z'" location: - https://tablesteststorname.table.core.windows.net/uttablede991889(PartitionKey='pkde991889',RowKey='rkde991889') server: @@ -111,27 +111,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT x-ms-version: - '2019-02-02' method: GET uri: https://tablesteststorname.table.core.windows.net/uttablede991889(PartitionKey='pkde991889',RowKey='rkde991889') response: body: - string: '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A39%3A12.0811252Z''\"","PartitionKey":"pkde991889","RowKey":"rkde991889","Timestamp":"2020-10-28T21:39:12.0811252Z","large@odata.type":"Edm.Int64","large":"1125899906842624"}' + string: !!python/unicode '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A02%3A10.3515865Z''\"","PartitionKey":"pkde991889","RowKey":"rkde991889","Timestamp":"2020-11-02T20:02:10.3515865Z","large@odata.type":"Edm.Int64","large":"1125899906842624"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 28 Oct 2020 21:39:11 GMT + - Mon, 02 Nov 2020 20:02:09 GMT etag: - - W/"datetime'2020-10-28T21%3A39%3A12.0811252Z'" + - W/"datetime'2020-11-02T20%3A02%3A10.3515865Z'" server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -144,9 +144,9 @@ interactions: code: 200 message: OK - request: - body: '{"PartitionKey": "pkde991889", "PartitionKey@odata.type": "Edm.String", - "RowKey": "negative", "RowKey@odata.type": "Edm.String", "large": "-1125899906842625", - "large@odata.type": "Edm.Int64"}' + body: !!python/unicode '{"large": "-1125899906842625", "RowKey@odata.type": "Edm.String", + "PartitionKey@odata.type": "Edm.String", "large@odata.type": "Edm.Int64", "PartitionKey": + "pkde991889", "RowKey": "negative"}' headers: Accept: - application/json;odata=minimalmetadata @@ -161,27 +161,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablesteststorname.table.core.windows.net/uttablede991889 response: body: - string: '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A39%3A12.2732596Z''\"","PartitionKey":"pkde991889","RowKey":"negative","Timestamp":"2020-10-28T21:39:12.2732596Z","large@odata.type":"Edm.Int64","large":"-1125899906842625"}' + string: !!python/unicode '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A02%3A10.4946891Z''\"","PartitionKey":"pkde991889","RowKey":"negative","Timestamp":"2020-11-02T20:02:10.4946891Z","large@odata.type":"Edm.Int64","large":"-1125899906842625"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:09 GMT etag: - - W/"datetime'2020-10-28T21%3A39%3A12.2732596Z'" + - W/"datetime'2020-11-02T20%3A02%3A10.4946891Z'" location: - https://tablesteststorname.table.core.windows.net/uttablede991889(PartitionKey='pkde991889',RowKey='negative') server: @@ -207,27 +207,27 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT x-ms-version: - '2019-02-02' method: GET uri: https://tablesteststorname.table.core.windows.net/uttablede991889(PartitionKey='pkde991889',RowKey='negative') response: body: - string: '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A39%3A12.2732596Z''\"","PartitionKey":"pkde991889","RowKey":"negative","Timestamp":"2020-10-28T21:39:12.2732596Z","large@odata.type":"Edm.Int64","large":"-1125899906842625"}' + string: !!python/unicode '{"odata.metadata":"https://tablesteststorname.table.core.windows.net/$metadata#uttablede991889/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A02%3A10.4946891Z''\"","PartitionKey":"pkde991889","RowKey":"negative","Timestamp":"2020-11-02T20:02:10.4946891Z","large@odata.type":"Edm.Int64","large":"-1125899906842625"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:09 GMT etag: - - W/"datetime'2020-10-28T21%3A39%3A12.2732596Z'" + - W/"datetime'2020-11-02T20%3A02%3A10.4946891Z'" server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -251,25 +251,25 @@ interactions: Content-Length: - '0' Date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:10 GMT x-ms-version: - '2019-02-02' method: DELETE uri: https://tablesteststorname.table.core.windows.net/Tables('uttablede991889') response: body: - string: '' + string: !!python/unicode headers: cache-control: - no-cache content-length: - '0' date: - - Wed, 28 Oct 2020 21:39:12 GMT + - Mon, 02 Nov 2020 20:02:09 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_cosmos.test_insert_entity_with_large_int_success.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_insert_entity_with_large_int_success.yaml index 07ec468aab9e..080ad6d53965 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_insert_entity_with_large_int_success.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_insert_entity_with_large_int_success.yaml @@ -1,6 +1,6 @@ interactions: - request: - body: '{"TableName": "uttable97fc1b7c"}' + body: !!python/unicode '{"TableName": "uttable97fc1b7c"}' headers: Accept: - application/json;odata=minimalmetadata @@ -15,25 +15,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:31 GMT + - Mon, 02 Nov 2020 20:14:27 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:31 GMT + - Mon, 02 Nov 2020 20:14:27 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablestestcosmosname.table.cosmos.azure.com/Tables response: body: - string: '{"TableName":"uttable97fc1b7c","odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/$metadata#Tables/@Element"}' + string: !!python/unicode '{"TableName":"uttable97fc1b7c","odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/$metadata#Tables/@Element"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:32 GMT + - Mon, 02 Nov 2020 20:14:28 GMT etag: - - W/"datetime'2020-10-28T21%3A53%3A33.1766279Z'" + - W/"datetime'2020-11-02T20%3A14%3A28.5594631Z'" location: - https://tablestestcosmosname.table.cosmos.azure.com/Tables('uttable97fc1b7c') server: @@ -44,9 +44,9 @@ interactions: code: 201 message: Ok - request: - body: '{"PartitionKey": "pk97fc1b7c", "PartitionKey@odata.type": "Edm.String", - "RowKey": "rk97fc1b7c", "RowKey@odata.type": "Edm.String", "large": "1125899906842624", - "large@odata.type": "Edm.Int64"}' + body: !!python/unicode '{"large": "1125899906842624", "RowKey@odata.type": "Edm.String", + "PartitionKey@odata.type": "Edm.String", "large@odata.type": "Edm.Int64", "PartitionKey": + "pk97fc1b7c", "RowKey": "rk97fc1b7c"}' headers: Accept: - application/json;odata=minimalmetadata @@ -61,25 +61,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c response: body: - string: '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A53%3A33.6507399Z''\"","PartitionKey":"pk97fc1b7c","RowKey":"rk97fc1b7c","large@odata.type":"Edm.Int64","large":"1125899906842624","Timestamp":"2020-10-28T21:53:33.6507399Z"}' + string: !!python/unicode '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A14%3A29.1036167Z''\"","large@odata.type":"Edm.Int64","large":"1125899906842624","PartitionKey":"pk97fc1b7c","RowKey":"rk97fc1b7c","Timestamp":"2020-11-02T20:14:29.1036167Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:32 GMT + - Mon, 02 Nov 2020 20:14:28 GMT etag: - - W/"datetime'2020-10-28T21%3A53%3A33.6507399Z'" + - W/"datetime'2020-11-02T20%3A14%3A29.1036167Z'" location: - https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c(PartitionKey='pk97fc1b7c',RowKey='rk97fc1b7c') server: @@ -101,25 +101,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: GET uri: https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c(PartitionKey='pk97fc1b7c',RowKey='rk97fc1b7c') response: body: - string: '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A53%3A33.6507399Z''\"","PartitionKey":"pk97fc1b7c","RowKey":"rk97fc1b7c","large@odata.type":"Edm.Int64","large":"1125899906842624","Timestamp":"2020-10-28T21:53:33.6507399Z"}' + string: !!python/unicode '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A14%3A29.1036167Z''\"","large@odata.type":"Edm.Int64","large":"1125899906842624","PartitionKey":"pk97fc1b7c","RowKey":"rk97fc1b7c","Timestamp":"2020-11-02T20:14:29.1036167Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:28 GMT etag: - - W/"datetime'2020-10-28T21%3A53%3A33.6507399Z'" + - W/"datetime'2020-11-02T20%3A14%3A29.1036167Z'" server: - Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -128,9 +128,9 @@ interactions: code: 200 message: Ok - request: - body: '{"PartitionKey": "pk97fc1b7c", "PartitionKey@odata.type": "Edm.String", - "RowKey": "negative", "RowKey@odata.type": "Edm.String", "large": "-1125899906842625", - "large@odata.type": "Edm.Int64"}' + body: !!python/unicode '{"large": "-1125899906842625", "RowKey@odata.type": "Edm.String", + "PartitionKey@odata.type": "Edm.String", "large@odata.type": "Edm.Int64", "PartitionKey": + "pk97fc1b7c", "RowKey": "negative"}' headers: Accept: - application/json;odata=minimalmetadata @@ -145,25 +145,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: POST uri: https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c response: body: - string: '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A53%3A33.8004487Z''\"","PartitionKey":"pk97fc1b7c","RowKey":"negative","large@odata.type":"Edm.Int64","large":"-1125899906842625","Timestamp":"2020-10-28T21:53:33.8004487Z"}' + string: !!python/unicode '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A14%3A29.2352007Z''\"","large@odata.type":"Edm.Int64","large":"-1125899906842625","PartitionKey":"pk97fc1b7c","RowKey":"negative","Timestamp":"2020-11-02T20:14:29.2352007Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:28 GMT etag: - - W/"datetime'2020-10-28T21%3A53%3A33.8004487Z'" + - W/"datetime'2020-11-02T20%3A14%3A29.2352007Z'" location: - https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c(PartitionKey='pk97fc1b7c',RowKey='negative') server: @@ -185,25 +185,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: GET uri: https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c(PartitionKey='pk97fc1b7c',RowKey='negative') response: body: - string: '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-10-28T21%3A53%3A33.8004487Z''\"","PartitionKey":"pk97fc1b7c","RowKey":"negative","large@odata.type":"Edm.Int64","large":"-1125899906842625","Timestamp":"2020-10-28T21:53:33.8004487Z"}' + string: !!python/unicode '{"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/uttable97fc1b7c/$metadata#uttable97fc1b7c/@Element","odata.etag":"W/\"datetime''2020-11-02T20%3A14%3A29.2352007Z''\"","large@odata.type":"Edm.Int64","large":"-1125899906842625","PartitionKey":"pk97fc1b7c","RowKey":"negative","Timestamp":"2020-11-02T20:14:29.2352007Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:28 GMT etag: - - W/"datetime'2020-10-28T21%3A53%3A33.8004487Z'" + - W/"datetime'2020-11-02T20%3A14%3A29.2352007Z'" server: - Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -223,23 +223,23 @@ interactions: Content-Length: - '0' Date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: DELETE uri: https://tablestestcosmosname.table.cosmos.azure.com/Tables('uttable97fc1b7c') response: body: - string: '' + string: !!python/unicode headers: content-length: - '0' date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:28 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -257,23 +257,23 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 28 Oct 2020 21:53:34 GMT + - Mon, 02 Nov 2020 20:14:29 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b3 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b3 Python/2.7.18 (Windows-10-10.0.19041) x-ms-date: - - Wed, 28 Oct 2020 21:53:34 GMT + - Mon, 02 Nov 2020 20:14:29 GMT x-ms-version: - '2019-02-02' method: GET uri: https://tablestestcosmosname.table.cosmos.azure.com/Tables response: body: - string: '{"value":[],"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/$metadata#Tables"}' + string: !!python/unicode '{"value":[],"odata.metadata":"https://tablestestcosmosname.table.cosmos.azure.com/$metadata#Tables"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 28 Oct 2020 21:53:33 GMT + - Mon, 02 Nov 2020 20:14:29 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: diff --git a/sdk/tables/azure-data-tables/tests/test_table_async.py b/sdk/tables/azure-data-tables/tests/test_table_async.py index 867b0db78531..31c69611cb5f 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_async.py +++ b/sdk/tables/azure-data-tables/tests/test_table_async.py @@ -430,8 +430,8 @@ async def test_account_sas(self, resource_group, location, storage_account, stor # Assert self.assertEqual(len(entities), 2) - self.assertEqual(entities[0].text.value, 'hello') - self.assertEqual(entities[1].text.value, 'hello') + self.assertEqual(entities[0].text, u'hello') + self.assertEqual(entities[1].text, u'hello') finally: await self._delete_table(table=table, ts=tsc) 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 05d2631a7964..538ee0740970 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 @@ -115,24 +115,24 @@ def _create_updated_entity_dict(self, partition, row): 'birthday': datetime(1991, 10, 4, tzinfo=tzutc()) } - def _assert_default_entity(self, entity, headers=None): + def _assert_default_entity(self, entity): ''' Asserts that the entity passed in matches the default entity. ''' - self.assertEqual(entity['age'].value, 39) - self.assertEqual(entity['sex'].value, u'male') + self.assertEqual(entity['age'], 39) + self.assertEqual(entity['sex'], 'male') self.assertEqual(entity['married'], True) self.assertEqual(entity['deceased'], False) self.assertFalse("optional" in entity) self.assertEqual(entity['ratio'], 3.1) self.assertEqual(entity['evenratio'], 3.0) - self.assertEqual(entity['large'].value, 933311100) + self.assertEqual(entity['large'], 933311100) self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc())) self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc())) self.assertEqual(entity['binary'].value, b'binary') - self.assertIsInstance(entity['other'], EntityProperty) - self.assertEqual(entity['other'].type, EdmType.INT32) - self.assertEqual(entity['other'].value, 20) + # self.assertIsInstance(entity['other'], EntityProperty) + # self.assertEqual(entity['other'].type, EdmType.INT32) + self.assertEqual(entity['other'], 20) self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833')) self.assertTrue('_metadata' in entity) @@ -140,11 +140,11 @@ def _assert_updated_entity(self, entity): ''' Asserts that the entity passed in matches the updated entity. ''' - self.assertEqual(entity.age.value, 'abc') - self.assertEqual(entity.sex.value, 'female') + self.assertEqual(entity.age, 'abc') + self.assertEqual(entity.sex, 'female') self.assertFalse(hasattr(entity, "married")) self.assertFalse(hasattr(entity, "deceased")) - self.assertEqual(entity.sign.value, 'aquarius') + self.assertEqual(entity.sign, 'aquarius') self.assertFalse(hasattr(entity, "optional")) self.assertFalse(hasattr(entity, "ratio")) self.assertFalse(hasattr(entity, "evenratio")) @@ -407,7 +407,7 @@ def test_batch_delete(self, resource_group, location, cosmos_account, cosmos_acc self.table.create_entity(entity) entity = self.table.get_entity(partition_key=u'001', row_key=u'batch_delete') - self.assertEqual(3, entity.test3.value) + self.assertEqual(3, entity.test3) batch = self.table.create_batch() batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) 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 24c1197517cc..57d5b8bfade0 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 @@ -130,20 +130,20 @@ def _assert_default_entity(self, entity): ''' Asserts that the entity passed in matches the default entity. ''' - self.assertEqual(entity['age'].value, 39) - self.assertEqual(entity['sex'].value, 'male') + self.assertEqual(entity['age'], 39) + self.assertEqual(entity['sex'], 'male') self.assertEqual(entity['married'], True) self.assertEqual(entity['deceased'], False) self.assertFalse("optional" in entity) self.assertEqual(entity['ratio'], 3.1) self.assertEqual(entity['evenratio'], 3.0) - self.assertEqual(entity['large'].value, 933311100) + self.assertEqual(entity['large'], 933311100) self.assertEqual(entity['Birthday'], datetime(1973, 10, 4, tzinfo=tzutc())) self.assertEqual(entity['birthday'], datetime(1970, 10, 4, tzinfo=tzutc())) self.assertEqual(entity['binary'].value, b'binary') - self.assertIsInstance(entity['other'], EntityProperty) - self.assertEqual(entity['other'].type, EdmType.INT32) - self.assertEqual(entity['other'].value, 20) + # self.assertIsInstance(entity['other'], EntityProperty) + # self.assertEqual(entity['other'].type, EdmType.INT32) + self.assertEqual(entity['other'], 20) self.assertEqual(entity['clsid'], uuid.UUID('c9da6455-213d-42c9-9a79-3e9149a57833')) self.assertTrue('_metadata' in entity) @@ -151,11 +151,11 @@ def _assert_updated_entity(self, entity): ''' Asserts that the entity passed in matches the updated entity. ''' - self.assertEqual(entity.age.value, 'abc') - self.assertEqual(entity.sex.value, 'female') + self.assertEqual(entity.age, 'abc') + self.assertEqual(entity.sex, 'female') self.assertFalse(hasattr(entity, "married")) self.assertFalse(hasattr(entity, "deceased")) - self.assertEqual(entity.sign.value, 'aquarius') + self.assertEqual(entity.sign, 'aquarius') self.assertFalse(hasattr(entity, "optional")) self.assertFalse(hasattr(entity, "ratio")) self.assertFalse(hasattr(entity, "evenratio")) @@ -198,11 +198,14 @@ async def test_batch_single_insert(self, resource_group, location, cosmos_accoun self._assert_valid_batch_transaction(transaction_result, 1) sent_entity = transaction_result.get_entity(entity.RowKey) self.assertIsNotNone(sent_entity) + e = await self.table.get_entity(row_key=entity.RowKey, partition_key=entity.PartitionKey) + self.assertEqual(e.test, entity.test.value) - self.assertEqual(e.test2.value, entity.test2) - self.assertEqual(e.test3.value, entity.test3) - self.assertEqual(e.test4.value, entity.test4.value) + self.assertEqual(e.test2, entity.test2) + self.assertEqual(e.test3, entity.test3) + self.assertEqual(e.test4, entity.test4.value) + self.assertEqual(sent_entity['test'], entity.test.value) self.assertEqual(sent_entity['test2'], entity.test2) self.assertEqual(sent_entity['test3'], entity.test3) @@ -472,7 +475,7 @@ async def test_batch_delete(self, resource_group, location, cosmos_account, cosm await self.table.create_entity(entity) entity = await self.table.get_entity(partition_key=u'001', row_key=u'batch_delete') - self.assertEqual(3, entity.test3.value) + self.assertEqual(3, entity.test3) batch = self.table.create_batch() batch.delete_entity(partition_key=entity.PartitionKey, row_key=entity.RowKey) 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 20177ba0f178..ea03f2b6eb7c 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -476,7 +476,7 @@ def test_insert_entity_with_large_int_success(self, resource_group, location, st received_entity = self.table.get_entity(dict64['PartitionKey'], dict64['RowKey']) assert received_entity['large'].value == dict64['large'].value - dict64['RowKey'] = 'negative' + dict64['RowKey'] = u'negative' dict64['large'] = EntityProperty(-(2 ** 50 + 1), EdmType.INT64) self.table.create_entity(entity=dict64) 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 c8fafefe2528..6be8d4ff33d3 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 @@ -480,7 +480,7 @@ def test_insert_entity_with_large_int_success(self, resource_group, location, co received_entity = self.table.get_entity(dict64['PartitionKey'], dict64['RowKey']) assert received_entity['large'].value == dict64['large'].value - dict64['RowKey'] = 'negative' + dict64['RowKey'] = u'negative' dict64['large'] = EntityProperty(-(2 ** 50 + 1), EdmType.INT64) self.table.create_entity(entity=dict64)