OData Type is Not Always Specified When Querying Entities
- Dominant language
- Python
- Stars
- 4.6k
- Forks
- 3.5k
- Avg merge
- 3d 2h
- Merged PRs (30d)
- 60
Description
**Describe the bug**
When querying an entity with minimal metadata retrieval, the OData type is not specified for all properties.
**To Reproduce**
1. Create test table
2. Insert test entity (through REST API, there are some issues with specifying OData type for numeric values, see #8032)
3. Query the test table
**Expected behavior**
Each property has OData type specified.
**Environment summary**
Install method: MSI (for Windows)
CLI version: azure-cli (2.0.52)
OS: Windows 10
Shell Type: PowerShell
**Additional context**
Below is the payload I used to create the entity:
```json
{
"BinaryProperty@odata.type": "Edm.Binary",
"BinaryProperty": "AQID",
"Boolean@odata.type": "Edm.Boolean",
"Boolean": true,
"DateTime@odata.type": "Edm.DateTime",
"DateTime": "2018-12-10T20:33:53.4475462Z",
"Double@odata.type": "Edm.Double",
"Double": 1.2,
"Guid@odata.type": "Edm.Guid",
"Guid": "41ddfac7-8f88-4c6c-bc91-a0aa2f036b05",
"Int32@odata.type": "Edm.Int32",
"Int32": 3,
"Int64@odata.type": "Edm.Int64",
"Int64": "4",
"String": "string"
}
```
Querying the test table:
```powershell
$connectionString = "storage emulator or actual storage account connection string"
$tableName = "MissingPropertyMetadataTestTable"
az storage entity query,
--accept minimal, # returns the same information as full option
--table-name $tableName,
--connection-string $connectionString
```
returns:
```js
{
"items": [
{
"BinaryProperty": {
"encrypt": false,
"type": "Edm.Binary",
"value": "\u0001\u0002\u0003" // see #8021, this should be a Base64 string
},
"Boolean": true, // no OData type, but can be inferred
"DateTime": "2018-12-10T20:33:53.447546+00:00", // no OData type and cannot be inferred (is this a string or a date time?)
"Double": 1.2, // no OData type, but can be inferred
"Guid": {
"encrypt": false,
"type": "Edm.Guid",
"value": "41ddfac7-8f88-4c6c-bc91-a0aa2f036b05"
},
"Int32": {
"encrypt": false,
"type": "Edm.Int32",
"value": 3
}, // this one is a bonus, can be hard to miss from the REST API response
"Int64": 4, // no OData type and cannot be inferred, is this a double, int32 or int64?
"PartitionKey": "partitionKey",
"RowKey": "rowKey",
"String": "string",
"Timestamp": "2018-12-10T22:35:22.723030+00:00",
"etag": "W/\"datetime'2018-12-10T22%3A35%3A22.7230307Z'\""
}
],
"nextMarker": {}
}
```
Contributor guide
Assessment
This issue has not been assessed yet.