From 06043876bee39031e2aedbffbc4d738b274fba2a Mon Sep 17 00:00:00 2001 From: Andrei Fangli Date: Sat, 19 Jan 2019 11:10:54 +0200 Subject: [PATCH] Fixed azure-cli/#8032, when OData type is already specified through previous property it is no longer being overwritten --- azure-cosmosdb-table/azure/cosmosdb/table/_serialization.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/azure-cosmosdb-table/azure/cosmosdb/table/_serialization.py b/azure-cosmosdb-table/azure/cosmosdb/table/_serialization.py index 6767337..c26b4da 100644 --- a/azure-cosmosdb-table/azure/cosmosdb/table/_serialization.py +++ b/azure-cosmosdb-table/azure/cosmosdb/table/_serialization.py @@ -198,8 +198,9 @@ def _convert_entity_to_json(source): # form the property node properties[name] = value - if mtype: - properties[name + '@odata.type'] = mtype + odataTypePropertyName = name + '@odata.type' + if mtype and odataTypePropertyName not in properties: + properties[odataTypePropertyName] = mtype # generate the entity_body return dumps(properties)