python 2.7 - Hashed or random values getting inserted in google cloud datastore -
task = datastore.entity(client.key('modeldatatest', prod_id)) task.update({ 'productid': '1234', 'listofrankedrelevantitems.productid': ['345', '456','567'], 'listofrankedrelevantitems.similarityscore': ['0.98', '0.89','0.77'] }) client.put(task)
using above code i'm creating entity in gc-datastore i'm getting prod_id blob 'mtizndu=' instead of string '1234' , productid ["mzix","mzq1","ndu2"] instead of ['345', '456','567'] , similarityscore ["mc45oa==","mc44nw==","mc43nw=="] instead of ['0.98', '0.89','0.77'] 1 having idea why , how proper values.
the issue in python 2 string represented bytestream , have convert unicode see results in gcloud datastore. use unicode() method solve issue.
Comments
Post a Comment