I'm working through some documentation for the google cloud datastore API
Namely https://googleapis.github.io/google-cloud-python/latest/datastore/client.html and https://googleapis.github.io/google-cloud-python/latest/_modules/google/cloud/datastore/entity.html#Entity
Using both sources I've created the following. I'm extremely confused by client.key(), namely the 1234 and namespace. My datastore shows the keys which seems to be a random? unique number and I have not seen any reference to a namespace. Why is this code sample specifying an integer and a namespace? Is there a better way to generate a key or can these two parameters be safely omitted?
from google.cloud import datastore
client = datastore.Client()
key = client.key('Collection', 1234, namespace='_Doctest')
entity = datastore.Entity(key=key)
entity['property'] = 'value'
client.put(entity)
