diff --git a/sdk/tables/azure-data-tables/CHANGELOG.md b/sdk/tables/azure-data-tables/CHANGELOG.md index 77a8bfee94e1..217ae52c87a6 100644 --- a/sdk/tables/azure-data-tables/CHANGELOG.md +++ b/sdk/tables/azure-data-tables/CHANGELOG.md @@ -3,6 +3,7 @@ ## 12.0.0b5 (Unreleased) * Bumped minimum requirement of msrest from `0.6.10` to `0.6.19`. +* Added support for datetime entities with milliseconds ## 12.0.0b4 (2020-01-12) * Fixes an [issue](https://github.com/Azure/azure-sdk-for-python/issues/15554) where `query_entities` kwarg `parameters` would not work with multiple parameters or with non-string parameters. This now works with multiple parameters and numeric, string, boolean, UUID, and datetime objects. diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_common_conversion.py b/sdk/tables/azure-data-tables/azure/data/tables/_common_conversion.py index 964c8822b217..d9c1116bc126 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_common_conversion.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_common_conversion.py @@ -28,7 +28,10 @@ def _to_str(value): def _to_utc_datetime(value): - return value.strftime("%Y-%m-%dT%H:%M:%SZ") + try: + return value.strftime("%Y-%m-%dT%H:%M:%S.%fZ") + except ValueError: + return value.strftime("%Y-%m-%dT%H:%M:%SZ") def _encode_base64(data): diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py index 86f4df027911..ad0c107d7a39 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_deserialize.py @@ -96,11 +96,32 @@ def tzname(self, dt): def _from_entity_datetime(value): # Cosmos returns this with a decimal point that throws an error on deserialization - if value[-9:] == ".0000000Z": - value = value[:-9] + "Z" - return datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ").replace( - tzinfo=Timezone() - ) + value = clean_up_dotnet_timestamps(value) + + try: + return datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%S.%fZ").replace( + tzinfo=Timezone() + ) + except ValueError: + return datetime.datetime.strptime(value, "%Y-%m-%dT%H:%M:%SZ").replace( + tzinfo=Timezone() + ) + + +def clean_up_dotnet_timestamps(value): + # .NET has more decimal places than Python supports in datetime objects, this truncates + # values after 6 decimal places. + value = value.split(".") + ms = "" + if len(value) == 2: + ms = value[-1].replace("Z", "") + if len(ms) > 6: + ms = ms[:6] + ms = ms + "Z" + return ".".join([value[0], ms]) + + return value[0] + def _from_entity_guid(value): diff --git a/sdk/tables/azure-data-tables/azure/data/tables/_error.py b/sdk/tables/azure-data-tables/azure/data/tables/_error.py index 3850d2ca52e6..506f328c32b6 100644 --- a/sdk/tables/azure-data-tables/azure/data/tables/_error.py +++ b/sdk/tables/azure-data-tables/azure/data/tables/_error.py @@ -24,15 +24,10 @@ def _str(value): return value.encode("utf-8") return str(value) - - else: _str = str -def _to_utc_datetime(value): - return value.strftime("%Y-%m-%dT%H:%M:%SZ") - def _to_str(value): return _str(value) if value is not None else None diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_datetime_milliseconds.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_datetime_milliseconds.yaml new file mode 100644 index 000000000000..0c2a1d297cd8 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_datetime_milliseconds.yaml @@ -0,0 +1,192 @@ +interactions: +- request: + body: '{"TableName": "uttable97bd1223"}' + 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, 22 Feb 2021 14:24:35 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:35 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":"uttable97bd1223"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 22 Feb 2021 14:24:35 GMT + location: + - https://fake_table_account.table.core.windows.net/Tables('uttable97bd1223') + 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": "pk97bd1223", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk97bd1223", "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", "milliseconds": "2011-11-04T00:05:23.283000Z", + "milliseconds@odata.type": "Edm.DateTime"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '681' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:35 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:35 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttable97bd1223 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable97bd1223/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A36.5672082Z''\"","PartitionKey":"pk97bd1223","RowKey":"rk97bd1223","Timestamp":"2021-02-22T14:24:36.5672082Z","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.283Z"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 22 Feb 2021 14:24:36 GMT + etag: + - W/"datetime'2021-02-22T14%3A24%3A36.5672082Z'" + location: + - https://fake_table_account.table.core.windows.net/uttable97bd1223(PartitionKey='pk97bd1223',RowKey='rk97bd1223') + 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 + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:36 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttable97bd1223(PartitionKey='pk97bd1223',RowKey='rk97bd1223') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable97bd1223/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A36.5672082Z''\"","PartitionKey":"pk97bd1223","RowKey":"rk97bd1223","Timestamp":"2021-02-22T14:24:36.5672082Z","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.283Z"}' + headers: + cache-control: + - no-cache + content-type: + - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: + - Mon, 22 Feb 2021 14:24:36 GMT + etag: + - W/"datetime'2021-02-22T14%3A24%3A36.5672082Z'" + 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, 22 Feb 2021 14:24:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:36 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttable97bd1223') + response: + body: + string: '' + headers: + cache-control: + - no-cache + content-length: + - '0' + date: + - Mon, 22 Feb 2021 14:24:36 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.test_query_user_filter_datetimes.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter_datetimes.yaml index 04a341c49cb0..0ffd80e12ac5 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter_datetimes.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity.test_query_user_filter_datetimes.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:11:33 GMT + - Mon, 22 Feb 2021 13:53:14 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:11:33 GMT + - Mon, 22 Feb 2021 13:53:14 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: - - Wed, 06 Jan 2021 19:11:32 GMT + - Mon, 22 Feb 2021 13:53:15 GMT location: - https://fake_table_account.table.core.windows.net/Tables('uttable114d14c9') server: @@ -51,10 +51,11 @@ interactions: body: '{"PartitionKey": "pk114d14c9", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk114d14c9", "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:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "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"}' + "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 @@ -63,33 +64,33 @@ interactions: Connection: - keep-alive Content-Length: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable114d14c9 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable114d14c9/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A11%3A32.6136547Z''\"","PartitionKey":"pk114d14c9","RowKey":"rk114d14c9","Timestamp":"2021-01-06T19:11:32.6136547Z","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#uttable114d14c9/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A15.9013159Z''\"","PartitionKey":"pk114d14c9","RowKey":"rk114d14c9","Timestamp":"2021-02-22T13:53:15.9013159Z","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: - - Wed, 06 Jan 2021 19:11:32 GMT + - Mon, 22 Feb 2021 13:53:15 GMT etag: - - W/"datetime'2021-01-06T19%3A11%3A32.6136547Z'" + - W/"datetime'2021-02-22T13%3A53%3A15.9013159Z'" location: - https://fake_table_account.table.core.windows.net/uttable114d14c9(PartitionKey='pk114d14c9',RowKey='rk114d14c9') server: @@ -107,11 +108,11 @@ interactions: body: '{"PartitionKey": "pk114d14c91", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk114d14c91", "RowKey@odata.type": "Edm.String", "age": 49, "sex": "female", "sex@odata.type": "Edm.String", "married": false, "deceased": true, - "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00Z", "birthday@odata.type": - "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": "Edm.Binary", - "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", "clsid@odata.type": - "Edm.Guid"}' + "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": + "Edm.Binary", "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", + "clsid@odata.type": "Edm.Guid"}' headers: Accept: - application/json;odata=minimalmetadata @@ -120,33 +121,33 @@ interactions: Connection: - keep-alive Content-Length: - - '592' + - '606' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable114d14c9 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable114d14c9/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A11%3A32.7377442Z''\"","PartitionKey":"pk114d14c91","RowKey":"rk114d14c91","Timestamp":"2021-01-06T19:11:32.7377442Z","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833"}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable114d14c9/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A16.0314087Z''\"","PartitionKey":"pk114d14c91","RowKey":"rk114d14c91","Timestamp":"2021-02-22T13:53:16.0314087Z","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833"}' headers: cache-control: - no-cache content-type: - application/json;odata=minimalmetadata;streaming=true;charset=utf-8 date: - - Wed, 06 Jan 2021 19:11:32 GMT + - Mon, 22 Feb 2021 13:53:15 GMT etag: - - W/"datetime'2021-01-06T19%3A11%3A32.7377442Z'" + - W/"datetime'2021-02-22T13%3A53%3A16.0314087Z'" location: - https://fake_table_account.table.core.windows.net/uttable114d14c9(PartitionKey='pk114d14c91',RowKey='rk114d14c91') server: @@ -172,25 +173,25 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT x-ms-version: - '2019-02-02' method: GET - uri: https://fake_table_account.table.core.windows.net/uttable114d14c9()?$filter=birthday%20eq%20datetime%271970-10-04T00%3A00%3A00Z%27 + uri: https://fake_table_account.table.core.windows.net/uttable114d14c9()?$filter=birthday%20eq%20datetime%271970-10-04T00%3A00%3A00.000000Z%27 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable114d14c9","value":[{"odata.etag":"W/\"datetime''2021-01-06T19%3A11%3A32.6136547Z''\"","PartitionKey":"pk114d14c9","RowKey":"rk114d14c9","Timestamp":"2021-01-06T19:11:32.6136547Z","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#uttable114d14c9","value":[{"odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A15.9013159Z''\"","PartitionKey":"pk114d14c9","RowKey":"rk114d14c9","Timestamp":"2021-02-22T13:53:15.9013159Z","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: - - Wed, 06 Jan 2021 19:11:32 GMT + - Mon, 22 Feb 2021 13:53:16 GMT server: - Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -214,11 +215,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:11:34 GMT + - Mon, 22 Feb 2021 13:53:15 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -232,7 +233,7 @@ interactions: content-length: - '0' date: - - Wed, 06 Jan 2021 19:11:32 GMT + - Mon, 22 Feb 2021 13:53:16 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_async.test_datetime_milliseconds.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_datetime_milliseconds.yaml new file mode 100644 index 000000000000..15a2d96a796f --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_datetime_milliseconds.yaml @@ -0,0 +1,147 @@ +interactions: +- request: + body: '{"TableName": "uttablee6814a0"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '31' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:36 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:36 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":"uttablee6814a0"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 22 Feb 2021 14:24:36 GMT + location: https://fake_table_account.table.core.windows.net/Tables('uttablee6814a0') + 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": "pke6814a0", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rke6814a0", "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", "milliseconds": "2011-11-04T00:05:23.283000Z", + "milliseconds@odata.type": "Edm.DateTime"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '679' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:37 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_table_account.table.core.windows.net/uttablee6814a0 + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablee6814a0/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A37.7329395Z''\"","PartitionKey":"pke6814a0","RowKey":"rke6814a0","Timestamp":"2021-02-22T14:24:37.7329395Z","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.283Z"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 22 Feb 2021 14:24:37 GMT + etag: W/"datetime'2021-02-22T14%3A24%3A37.7329395Z'" + location: https://fake_table_account.table.core.windows.net/uttablee6814a0(PartitionKey='pke6814a0',RowKey='rke6814a0') + 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/uttablee6814a0 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:37 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_table_account.table.core.windows.net/uttablee6814a0(PartitionKey='pke6814a0',RowKey='rke6814a0') + response: + body: + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttablee6814a0/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A37.7329395Z''\"","PartitionKey":"pke6814a0","RowKey":"rke6814a0","Timestamp":"2021-02-22T14:24:37.7329395Z","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.283Z"}' + headers: + cache-control: no-cache + content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 + date: Mon, 22 Feb 2021 14:24:37 GMT + etag: W/"datetime'2021-02-22T14%3A24%3A37.7329395Z'" + 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/uttablee6814a0(PartitionKey='pke6814a0',RowKey='rke6814a0') +- request: + body: null + headers: + Accept: + - application/json + Date: + - Mon, 22 Feb 2021 14:24:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:37 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_table_account.table.core.windows.net/Tables('uttablee6814a0') + response: + body: + string: '' + headers: + cache-control: no-cache + content-length: '0' + date: Mon, 22 Feb 2021 14:24:37 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('uttablee6814a0') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_user_filter_datetimes.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_user_filter_datetimes.yaml index b543bab0e86a..3502bc43f326 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_user_filter_datetimes.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_async.test_query_user_filter_datetimes.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 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: Wed, 06 Jan 2021 19:14:52 GMT + date: Mon, 22 Feb 2021 13:53:16 GMT location: https://fake_table_account.table.core.windows.net/Tables('uttable96d71746') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -40,37 +40,38 @@ interactions: body: '{"PartitionKey": "pk96d71746", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk96d71746", "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:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "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"}' + "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: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable96d71746 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable96d71746/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A14%3A52.824101Z''\"","PartitionKey":"pk96d71746","RowKey":"rk96d71746","Timestamp":"2021-01-06T19:14:52.824101Z","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#uttable96d71746/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A17.1623617Z''\"","PartitionKey":"pk96d71746","RowKey":"rk96d71746","Timestamp":"2021-02-22T13:53:17.1623617Z","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: Wed, 06 Jan 2021 19:14:52 GMT - etag: W/"datetime'2021-01-06T19%3A14%3A52.824101Z'" + date: Mon, 22 Feb 2021 13:53:16 GMT + etag: W/"datetime'2021-02-22T13%3A53%3A17.1623617Z'" location: https://fake_table_account.table.core.windows.net/uttable96d71746(PartitionKey='pk96d71746',RowKey='rk96d71746') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -84,38 +85,38 @@ interactions: body: '{"PartitionKey": "pk96d717461", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk96d717461", "RowKey@odata.type": "Edm.String", "age": 49, "sex": "female", "sex@odata.type": "Edm.String", "married": false, "deceased": true, - "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00Z", "birthday@odata.type": - "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": "Edm.Binary", - "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", "clsid@odata.type": - "Edm.Guid"}' + "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": + "Edm.Binary", "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", + "clsid@odata.type": "Edm.Guid"}' headers: Accept: - application/json;odata=minimalmetadata Content-Length: - - '592' + - '606' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:14:54 GMT + - Mon, 22 Feb 2021 13:53:16 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_table_account.table.core.windows.net/uttable96d71746 response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable96d71746/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A14%3A52.944189Z''\"","PartitionKey":"pk96d717461","RowKey":"rk96d717461","Timestamp":"2021-01-06T19:14:52.944189Z","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833"}' + string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable96d71746/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A17.3484942Z''\"","PartitionKey":"pk96d717461","RowKey":"rk96d717461","Timestamp":"2021-02-22T13:53:17.3484942Z","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833"}' headers: cache-control: no-cache content-type: application/json;odata=minimalmetadata;streaming=true;charset=utf-8 - date: Wed, 06 Jan 2021 19:14:52 GMT - etag: W/"datetime'2021-01-06T19%3A14%3A52.944189Z'" + date: Mon, 22 Feb 2021 13:53:16 GMT + etag: W/"datetime'2021-02-22T13%3A53%3A17.3484942Z'" location: https://fake_table_account.table.core.windows.net/uttable96d71746(PartitionKey='pk96d717461',RowKey='rk96d717461') server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -133,22 +134,22 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:14:55 GMT + - Mon, 22 Feb 2021 13:53:16 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:14:55 GMT + - Mon, 22 Feb 2021 13:53:16 GMT x-ms-version: - '2019-02-02' method: GET - uri: https://fake_table_account.table.core.windows.net/uttable96d71746()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00Z' + uri: https://fake_table_account.table.core.windows.net/uttable96d71746()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00.000000Z' response: body: - string: '{"odata.metadata":"https://fake_table_account.table.core.windows.net/$metadata#uttable96d71746","value":[{"odata.etag":"W/\"datetime''2021-01-06T19%3A14%3A52.824101Z''\"","PartitionKey":"pk96d71746","RowKey":"rk96d71746","Timestamp":"2021-01-06T19:14:52.824101Z","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#uttable96d71746","value":[{"odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A17.1623617Z''\"","PartitionKey":"pk96d71746","RowKey":"rk96d71746","Timestamp":"2021-02-22T13:53:17.1623617Z","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: Wed, 06 Jan 2021 19:14:52 GMT + date: Mon, 22 Feb 2021 13:53:16 GMT server: Windows-Azure-Table/1.0 Microsoft-HTTPAPI/2.0 transfer-encoding: chunked x-content-type-options: nosniff @@ -156,18 +157,18 @@ interactions: status: code: 200 message: OK - url: https://seankaneprim.table.core.windows.net/uttable96d71746()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00Z' + url: https://seankaneprim.table.core.windows.net/uttable96d71746()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00.000000Z' - request: body: null headers: Accept: - application/json Date: - - Wed, 06 Jan 2021 19:14:55 GMT + - Mon, 22 Feb 2021 13:53:16 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:14:55 GMT + - Mon, 22 Feb 2021 13:53:16 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -178,7 +179,7 @@ interactions: headers: cache-control: no-cache content-length: '0' - date: Wed, 06 Jan 2021 19:14:52 GMT + date: Mon, 22 Feb 2021 13:53:16 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_cosmos.test_datetime_milliseconds.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_datetime_milliseconds.yaml new file mode 100644 index 000000000000..9986f6591398 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_datetime_milliseconds.yaml @@ -0,0 +1,206 @@ +interactions: +- request: + body: '{"TableName": "uttable24e31516"}' + 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, 22 Feb 2021 14:24:37 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:37 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttable24e31516","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 22 Feb 2021 14:24:40 GMT + etag: + - W/"datetime'2021-02-22T14%3A24%3A40.6199304Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable24e31516') + server: + - Microsoft-HTTPAPI/2.0 + transfer-encoding: + - chunked + status: + code: 201 + message: Ok +- request: + body: '{"PartitionKey": "pk24e31516", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rk24e31516", "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", "milliseconds": "2011-11-04T00:05:23.283000Z", + "milliseconds@odata.type": "Edm.DateTime"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Accept-Encoding: + - gzip, deflate + Connection: + - keep-alive + Content-Length: + - '681' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:40 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:40 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable24e31516 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable24e31516/$metadata#uttable24e31516/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A41.4203912Z''\"","PartitionKey":"pk24e31516","RowKey":"rk24e31516","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.2830000Z","Timestamp":"2021-02-22T14:24:41.4203912Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 22 Feb 2021 14:24:41 GMT + etag: + - W/"datetime'2021-02-22T14%3A24%3A41.4203912Z'" + location: + - https://fake_cosmos_account.table.cosmos.azure.com/uttable24e31516(PartitionKey='pk24e31516',RowKey='rk24e31516') + 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 + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:24:40 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:40 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable24e31516(PartitionKey='pk24e31516',RowKey='rk24e31516') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable24e31516/$metadata#uttable24e31516/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A24%3A41.4203912Z''\"","PartitionKey":"pk24e31516","RowKey":"rk24e31516","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.2830000Z","Timestamp":"2021-02-22T14:24:41.4203912Z"}' + headers: + content-type: + - application/json;odata=minimalmetadata + date: + - Mon, 22 Feb 2021 14:24:41 GMT + etag: + - W/"datetime'2021-02-22T14%3A24%3A41.4203912Z'" + 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, 22 Feb 2021 14:24:41 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:41 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable24e31516') + response: + body: + string: '' + headers: + content-length: + - '0' + date: + - Mon, 22 Feb 2021 14:24:41 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, 22 Feb 2021 14:24:41 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:24:41 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, 22 Feb 2021 14:24:41 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.test_query_user_filter_datetimes.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_query_user_filter_datetimes.yaml index 51736cb80551..2de21fa0eace 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_query_user_filter_datetimes.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos.test_query_user_filter_datetimes.yaml @@ -15,11 +15,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:18:01 GMT + - Mon, 22 Feb 2021 13:53:17 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:01 GMT + - Mon, 22 Feb 2021 13:53:17 GMT x-ms-version: - '2019-02-02' method: POST @@ -31,9 +31,9 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:20 GMT etag: - - W/"datetime'2021-01-06T19%3A18%3A00.7086088Z'" + - W/"datetime'2021-02-22T13%3A53%3A20.2417672Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttableb01617bc') server: @@ -47,10 +47,11 @@ interactions: body: '{"PartitionKey": "pkb01617bc", "PartitionKey@odata.type": "Edm.String", "RowKey": "rkb01617bc", "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:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "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"}' + "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 @@ -59,31 +60,31 @@ interactions: Connection: - keep-alive Content-Length: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:20 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:20 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc/$metadata#uttableb01617bc/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A18%3A01.2901384Z''\"","PartitionKey":"pkb01617bc","RowKey":"rkb01617bc","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-01-06T19:18:01.2901384Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc/$metadata#uttableb01617bc/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A21.4696456Z''\"","PartitionKey":"pkb01617bc","RowKey":"rkb01617bc","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-02-22T13:53:21.4696456Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:20 GMT etag: - - W/"datetime'2021-01-06T19%3A18%3A01.2901384Z'" + - W/"datetime'2021-02-22T13%3A53%3A21.4696456Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc(PartitionKey='pkb01617bc',RowKey='rkb01617bc') server: @@ -97,11 +98,11 @@ interactions: body: '{"PartitionKey": "pkb01617bc1", "PartitionKey@odata.type": "Edm.String", "RowKey": "rkb01617bc1", "RowKey@odata.type": "Edm.String", "age": 49, "sex": "female", "sex@odata.type": "Edm.String", "married": false, "deceased": true, - "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00Z", "birthday@odata.type": - "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": "Edm.Binary", - "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", "clsid@odata.type": - "Edm.Guid"}' + "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": + "Edm.Binary", "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", + "clsid@odata.type": "Edm.Guid"}' headers: Accept: - application/json;odata=minimalmetadata @@ -110,31 +111,31 @@ interactions: Connection: - keep-alive Content-Length: - - '592' + - '606' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:20 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:20 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc/$metadata#uttableb01617bc/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A18%3A01.4064648Z''\"","PartitionKey":"pkb01617bc1","RowKey":"rkb01617bc1","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833","Timestamp":"2021-01-06T19:18:01.4064648Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc/$metadata#uttableb01617bc/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A21.6239624Z''\"","PartitionKey":"pkb01617bc1","RowKey":"rkb01617bc1","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833","Timestamp":"2021-02-22T13:53:21.6239624Z"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:21 GMT etag: - - W/"datetime'2021-01-06T19%3A18%3A01.4064648Z'" + - W/"datetime'2021-02-22T13%3A53%3A21.6239624Z'" location: - https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc(PartitionKey='pkb01617bc1',RowKey='rkb01617bc1') server: @@ -156,23 +157,23 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:21 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:21 GMT x-ms-version: - '2019-02-02' method: GET - uri: https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc()?$filter=birthday%20eq%20datetime%271970-10-04T00%3A00%3A00Z%27 + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttableb01617bc()?$filter=birthday%20eq%20datetime%271970-10-04T00%3A00%3A00.000000Z%27 response: body: - string: '{"value":[{"odata.etag":"W/\"datetime''2021-01-06T19%3A18%3A01.2901384Z''\"","PartitionKey":"pkb01617bc","RowKey":"rkb01617bc","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-01-06T19:18:01.2901384Z"}],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttableb01617bc"}' + string: '{"value":[{"odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A21.4696456Z''\"","PartitionKey":"pkb01617bc","RowKey":"rkb01617bc","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-02-22T13:53:21.4696456Z"}],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttableb01617bc"}' headers: content-type: - application/json;odata=minimalmetadata date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:21 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: @@ -192,11 +193,11 @@ interactions: Content-Length: - '0' Date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:21 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:21 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -208,7 +209,7 @@ interactions: content-length: - '0' date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:21 GMT server: - Microsoft-HTTPAPI/2.0 status: @@ -226,11 +227,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:22 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:18:03 GMT + - Mon, 22 Feb 2021 13:53:22 GMT x-ms-version: - '2019-02-02' method: GET @@ -242,7 +243,7 @@ interactions: content-type: - application/json;odata=minimalmetadata date: - - Wed, 06 Jan 2021 19:18:00 GMT + - Mon, 22 Feb 2021 13:53:22 GMT server: - Microsoft-HTTPAPI/2.0 transfer-encoding: diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_datetime_milliseconds.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_datetime_milliseconds.yaml new file mode 100644 index 000000000000..5ec920ea5784 --- /dev/null +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_datetime_milliseconds.yaml @@ -0,0 +1,136 @@ +interactions: +- request: + body: '{"TableName": "uttablead311793"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '32' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:25:11 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:25:11 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables + response: + body: + string: '{"TableName":"uttablead311793","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 22 Feb 2021 14:25:13 GMT + etag: W/"datetime'2021-02-22T14%3A25%3A13.5132680Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablead311793') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/Tables +- request: + body: '{"PartitionKey": "pkad311793", "PartitionKey@odata.type": "Edm.String", + "RowKey": "rkad311793", "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", "milliseconds": "2011-11-04T00:05:23.283000Z", + "milliseconds@odata.type": "Edm.DateTime"}' + headers: + Accept: + - application/json;odata=minimalmetadata + Content-Length: + - '681' + Content-Type: + - application/json;odata=nometadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:25:13 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:25:13 GMT + x-ms-version: + - '2019-02-02' + method: POST + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablead311793 + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablead311793/$metadata#uttablead311793/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A25%3A14.2576136Z''\"","PartitionKey":"pkad311793","RowKey":"rkad311793","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.2830000Z","Timestamp":"2021-02-22T14:25:14.2576136Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 22 Feb 2021 14:25:14 GMT + etag: W/"datetime'2021-02-22T14%3A25%3A14.2576136Z'" + location: https://fake_cosmos_account.table.cosmos.azure.com/uttablead311793(PartitionKey='pkad311793',RowKey='rkad311793') + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 201 + message: Created + url: https://seankaneprim.table.cosmos.azure.com/uttablead311793 +- request: + body: null + headers: + Accept: + - application/json;odata=minimalmetadata + DataServiceVersion: + - '3.0' + Date: + - Mon, 22 Feb 2021 14:25:13 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:25:13 GMT + x-ms-version: + - '2019-02-02' + method: GET + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttablead311793(PartitionKey='pkad311793',RowKey='rkad311793') + response: + body: + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttablead311793/$metadata#uttablead311793/@Element","odata.etag":"W/\"datetime''2021-02-22T14%3A25%3A14.2576136Z''\"","PartitionKey":"pkad311793","RowKey":"rkad311793","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","milliseconds@odata.type":"Edm.DateTime","milliseconds":"2011-11-04T00:05:23.2830000Z","Timestamp":"2021-02-22T14:25:14.2576136Z"}' + headers: + content-type: application/json;odata=minimalmetadata + date: Mon, 22 Feb 2021 14:25:14 GMT + etag: W/"datetime'2021-02-22T14%3A25%3A14.2576136Z'" + server: Microsoft-HTTPAPI/2.0 + transfer-encoding: chunked + status: + code: 200 + message: Ok + url: https://seankaneprim.table.cosmos.azure.com/uttablead311793(PartitionKey='pkad311793',RowKey='rkad311793') +- request: + body: null + headers: + Accept: + - application/json + Date: + - Mon, 22 Feb 2021 14:25:13 GMT + User-Agent: + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + x-ms-date: + - Mon, 22 Feb 2021 14:25:13 GMT + x-ms-version: + - '2019-02-02' + method: DELETE + uri: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttablead311793') + response: + body: + string: '' + headers: + content-length: '0' + date: Mon, 22 Feb 2021 14:25:14 GMT + server: Microsoft-HTTPAPI/2.0 + status: + code: 204 + message: No Content + url: https://seankaneprim.table.cosmos.azure.com/Tables('uttablead311793') +version: 1 diff --git a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_query_user_filter_datetimes.yaml b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_query_user_filter_datetimes.yaml index 6b01aeaa44a9..d912cce21d2c 100644 --- a/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_query_user_filter_datetimes.yaml +++ b/sdk/tables/azure-data-tables/tests/recordings/test_table_entity_cosmos_async.test_query_user_filter_datetimes.yaml @@ -11,11 +11,11 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:22:32 GMT + - Mon, 22 Feb 2021 13:53:52 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:22:32 GMT + - Mon, 22 Feb 2021 13:53:52 GMT x-ms-version: - '2019-02-02' method: POST @@ -25,8 +25,8 @@ interactions: string: '{"TableName":"uttable47611a39","odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#Tables/@Element"}' headers: content-type: application/json;odata=minimalmetadata - date: Wed, 06 Jan 2021 19:22:30 GMT - etag: W/"datetime'2021-01-06T19%3A22%3A30.4645128Z'" + date: Mon, 22 Feb 2021 13:53:54 GMT + etag: W/"datetime'2021-02-22T13%3A53%3A54.4158216Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/Tables('uttable47611a39') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -38,36 +38,37 @@ interactions: body: '{"PartitionKey": "pk47611a39", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk47611a39", "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:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1970-10-04T00:00:00Z", "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"}' + "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: - - '577' + - '591' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39 response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39/$metadata#uttable47611a39/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A22%3A31.0592520Z''\"","PartitionKey":"pk47611a39","RowKey":"rk47611a39","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-01-06T19:22:31.0592520Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39/$metadata#uttable47611a39/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A55.1257608Z''\"","PartitionKey":"pk47611a39","RowKey":"rk47611a39","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-02-22T13:53:55.1257608Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Wed, 06 Jan 2021 19:22:30 GMT - etag: W/"datetime'2021-01-06T19%3A22%3A31.0592520Z'" + date: Mon, 22 Feb 2021 13:53:54 GMT + etag: W/"datetime'2021-02-22T13%3A53%3A55.1257608Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39(PartitionKey='pk47611a39',RowKey='rk47611a39') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -79,37 +80,37 @@ interactions: body: '{"PartitionKey": "pk47611a391", "PartitionKey@odata.type": "Edm.String", "RowKey": "rk47611a391", "RowKey@odata.type": "Edm.String", "age": 49, "sex": "female", "sex@odata.type": "Edm.String", "married": false, "deceased": true, - "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00Z", - "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00Z", "birthday@odata.type": - "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": "Edm.Binary", - "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", "clsid@odata.type": - "Edm.Guid"}' + "ratio": 5.2, "evenratio": 6.0, "large": 39999011, "Birthday": "1993-04-01T00:00:00.000000Z", + "Birthday@odata.type": "Edm.DateTime", "birthday": "1990-04-01T00:00:00.000000Z", + "birthday@odata.type": "Edm.DateTime", "binary": "YmluYXJ5LWJpbmFyeQ==", "binary@odata.type": + "Edm.Binary", "other": 40, "clsid": "c8da6455-213e-42d9-9b79-3f9149a57833", + "clsid@odata.type": "Edm.Guid"}' headers: Accept: - application/json;odata=minimalmetadata Content-Length: - - '592' + - '606' Content-Type: - application/json;odata=nometadata DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT x-ms-version: - '2019-02-02' method: POST uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39 response: body: - string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39/$metadata#uttable47611a39/@Element","odata.etag":"W/\"datetime''2021-01-06T19%3A22%3A31.1686152Z''\"","PartitionKey":"pk47611a391","RowKey":"rk47611a391","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833","Timestamp":"2021-01-06T19:22:31.1686152Z"}' + string: '{"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39/$metadata#uttable47611a39/@Element","odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A55.3397768Z''\"","PartitionKey":"pk47611a391","RowKey":"rk47611a391","age":49,"sex":"female","married":false,"deceased":true,"ratio":5.2,"evenratio":6.0,"large":39999011,"Birthday@odata.type":"Edm.DateTime","Birthday":"1993-04-01T00:00:00.0000000Z","birthday@odata.type":"Edm.DateTime","birthday":"1990-04-01T00:00:00.0000000Z","binary@odata.type":"Edm.Binary","binary":"YmluYXJ5LWJpbmFyeQ==","other":40,"clsid@odata.type":"Edm.Guid","clsid":"c8da6455-213e-42d9-9b79-3f9149a57833","Timestamp":"2021-02-22T13:53:55.3397768Z"}' headers: content-type: application/json;odata=minimalmetadata - date: Wed, 06 Jan 2021 19:22:30 GMT - etag: W/"datetime'2021-01-06T19%3A22%3A31.1686152Z'" + date: Mon, 22 Feb 2021 13:53:54 GMT + etag: W/"datetime'2021-02-22T13%3A53%3A55.3397768Z'" location: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39(PartitionKey='pk47611a391',RowKey='rk47611a391') server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked @@ -125,38 +126,38 @@ interactions: DataServiceVersion: - '3.0' Date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:54 GMT x-ms-version: - '2019-02-02' method: GET - uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00Z' + uri: https://fake_cosmos_account.table.cosmos.azure.com/uttable47611a39()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00.000000Z' response: body: - string: '{"value":[{"odata.etag":"W/\"datetime''2021-01-06T19%3A22%3A31.0592520Z''\"","PartitionKey":"pk47611a39","RowKey":"rk47611a39","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-01-06T19:22:31.0592520Z"}],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttable47611a39"}' + string: '{"value":[{"odata.etag":"W/\"datetime''2021-02-22T13%3A53%3A55.1257608Z''\"","PartitionKey":"pk47611a39","RowKey":"rk47611a39","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-02-22T13:53:55.1257608Z"}],"odata.metadata":"https://fake_cosmos_account.table.cosmos.azure.com/$metadata#uttable47611a39"}' headers: content-type: application/json;odata=minimalmetadata - date: Wed, 06 Jan 2021 19:22:31 GMT + date: Mon, 22 Feb 2021 13:53:54 GMT server: Microsoft-HTTPAPI/2.0 transfer-encoding: chunked status: code: 200 message: Ok - url: https://seankaneprim.table.cosmos.azure.com/uttable47611a39()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00Z' + url: https://seankaneprim.table.cosmos.azure.com/uttable47611a39()?$filter=birthday%20eq%20datetime'1970-10-04T00:00:00.000000Z' - request: body: null headers: Accept: - application/json Date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:55 GMT User-Agent: - - azsdk-python-data-tables/12.0.0b4 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) + - azsdk-python-data-tables/12.0.0b5 Python/3.9.0rc1 (Windows-10-10.0.19041-SP0) x-ms-date: - - Wed, 06 Jan 2021 19:22:33 GMT + - Mon, 22 Feb 2021 13:53:55 GMT x-ms-version: - '2019-02-02' method: DELETE @@ -166,7 +167,7 @@ interactions: string: '' headers: content-length: '0' - date: Wed, 06 Jan 2021 19:22:31 GMT + date: Mon, 22 Feb 2021 13:53:55 GMT server: Microsoft-HTTPAPI/2.0 status: code: 204 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 605960de62fb..4553e18335ee 100644 --- a/sdk/tables/azure-data-tables/tests/test_table_entity.py +++ b/sdk/tables/azure-data-tables/tests/test_table_entity.py @@ -1887,3 +1887,25 @@ def test_sas_signed_identifier(self, tables_storage_account_name, tables_primary self._assert_default_entity(entities[0]) finally: self._tear_down() + + @TablesPreparer() + def test_datetime_milliseconds(self, tables_storage_account_name, tables_primary_storage_account_key): + # SAS URL is calculated from storage key, so this test runs live only + url = self.account_url(tables_storage_account_name, "table") + self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity = self._create_random_entity_dict() + + entity['milliseconds'] = datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=tzutc()) + + self.table.create_entity(entity) + + received_entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + assert entity['milliseconds'] == received_entity['milliseconds'] + + finally: + self._tear_down() 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 6bf4f0f21073..2f4c4b48522c 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 @@ -1871,3 +1871,25 @@ async def test_sas_signed_identifier(self, tables_storage_account_name, tables_p self._assert_default_entity(entities[0]) finally: await self._tear_down() + + @TablesPreparer() + async def test_datetime_milliseconds(self, tables_storage_account_name, tables_primary_storage_account_key): + # SAS URL is calculated from storage key, so this test runs live only + url = self.account_url(tables_storage_account_name, "table") + await self._set_up(tables_storage_account_name, tables_primary_storage_account_key) + try: + entity = self._create_random_entity_dict() + + entity['milliseconds'] = datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=tzutc()) + + await self.table.create_entity(entity) + + received_entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + assert entity['milliseconds'] == received_entity['milliseconds'] + + finally: + await self._tear_down() \ No newline at end of file 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 18091aa04b14..c642b233b4c0 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 @@ -1944,3 +1944,26 @@ def test_sas_signed_identifier(self, tables_cosmos_account_name, tables_primary_ finally: self._tear_down() self.sleep(SLEEP_DELAY) + + @CosmosPreparer() + def test_datetime_milliseconds(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # SAS URL is calculated from storage key, so this test runs live only + url = self.account_url(tables_cosmos_account_name, "table") + self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity = self._create_random_entity_dict() + + entity['milliseconds'] = datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=tzutc()) + + self.table.create_entity(entity) + + received_entity = self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + assert entity['milliseconds'] == received_entity['milliseconds'] + + finally: + self._tear_down() + self.sleep(SLEEP_DELAY) \ No newline at end of file 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 7b21757e92e3..084e00ba3cfa 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 @@ -2030,3 +2030,26 @@ async def test_sas_signed_identifier(self, tables_cosmos_account_name, tables_pr await self._tear_down() if self.is_live: sleep(SLEEP_DELAY) + + @CosmosPreparer() + async def test_datetime_milliseconds(self, tables_cosmos_account_name, tables_primary_cosmos_account_key): + # SAS URL is calculated from storage key, so this test runs live only + url = self.account_url(tables_cosmos_account_name, "table") + await self._set_up(tables_cosmos_account_name, tables_primary_cosmos_account_key) + try: + entity = self._create_random_entity_dict() + + entity['milliseconds'] = datetime(2011, 11, 4, 0, 5, 23, 283000, tzinfo=tzutc()) + + await self.table.create_entity(entity) + + received_entity = await self.table.get_entity( + partition_key=entity['PartitionKey'], + row_key=entity['RowKey'] + ) + + assert entity['milliseconds'] == received_entity['milliseconds'] + + finally: + await self._tear_down() + self.sleep(SLEEP_DELAY) \ No newline at end of file