from google.cloud import datastorekey = client.key('Person')item = datastore.Entity(key, exclude_from_indexes=('address', 'note'))item.update({ 'name': 'Desmond', 'age': 10, 'address': 'Secret Lane', 'note': ''})# update exclude_from_indexes during runtimeitem.exclude_from_indexes.add('another_property')item.exclude_from_indexes = set(('address', 'note'))key = client.put(item)
References: