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

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -