-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.status: awaiting informationtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.
Description
Related to #3767
Currently, Sending an empty array results in the field not being set.
from google.cloud import datastore
ds = datastore.Client()
key = ds.key('Test')
entity = datastore.Entity(key=key)
entity['children'] = []
ds.put(entity)
print(entity)
value = ds.get(entity.key)
print(value)
key = ds.key('Test')
entity = datastore.Entity(key=key)
entity['children'] = ['A']
ds.put(entity)
print(entity)
value = ds.get(entity.key)
print(value)Output:
<Entity('Test', 5707090131681280) {'children': []}>
<Entity('Test', 5707090131681280) {}>
<Entity('Test', 5682274280407040) {'children': ['A']}>
<Entity('Test', 5682274280407040) {'children': ['A']}>
Metadata
Metadata
Assignees
Labels
api: datastoreIssues related to the Datastore API.Issues related to the Datastore API.status: awaiting informationtype: questionRequest for information or clarification. Not an issue.Request for information or clarification. Not an issue.