-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
api: firestoreIssues related to the Firestore API.Issues related to the Firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.The issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
When saving data to firestore with an attribute that is an empty {}:
if the date fields are firestore.SERVER_TIMESTAMP then the field with an empty {} is not persisted to the db but if the date fields are Datetime instances then the empty object fields are persisted.
OS type and version
- MacOS 10.13.6 (17G2307)
- DOCKER container: Linux version 4.9.93-linuxkit-aufs (root@856d34d1168e) (gcc version 6.4.0 (Alpin
e 6.4.0) ) Add support for namespaces #1 SMP Wed Jun 6 16:55:56 UTC 2018
Python version and virtual environment information python --version
Python 3.6.6
google-cloud-python versions
google-api-core==1.3.0
google-auth==1.5.1
google-cloud-core==0.28.1
google-cloud-firestore==0.29.0
google-cloud-storage==1.11.0
google-resumable-media==0.3.1
Stacktrace if available
NA
Steps to reproduce
- save to the db:
data = {
'date_created': firestore.SERVER_TIMESTAMP,
'date_modified': firestore.SERVER_TIMESTAMP,
'resources': {}
}
transaction.set(
reference,
data,
option=db.write_option(exists=False),
)- look in firestore and notice
resourcesattribute is not present.
save with date_created and date_modified = datetime.datetime.utcnow() and resources attributes is set with an empty object value.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: firestoreIssues related to the Firestore API.Issues related to the Firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.status: investigatingThe issue is under investigation, which is determined to be non-trivial.The issue is under investigation, which is determined to be non-trivial.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.