How to specify property type when using Cloud Datastore API
<p>I have this python code snippet for adding a new entity from Google Compute Engine. But this code results in userId being created with an undefined type. How can I specify the type of the property when it is getting created from compute engine?</p>

<pre><code>kg = datastore.Entity(key)
try:
  kg.update({
    'userId': userId,
  })
  client.put(kg)
</code></pre>

<p><code>gloud-python</code> will infer the type of the property from the type of the value you place in the property map.</p>

<p><a href="https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/datastore/helpers.py#L303" rel="nofollow">https://github.com/GoogleCloudPlatform/gcloud-python/blob/master/gcloud/datastore/helpers.py#L303</a></p>

python google-cloud-datastore