-
Notifications
You must be signed in to change notification settings - Fork 344
Closed
Description
[REQUIRED] Step 2: Describe your environment
- Operating System version: macOS
- Firebase SDK version: 2.2.0
- Firebase Product: database (auth, database, storage, etc)
[REQUIRED] Step 3: Describe the problem
Steps to reproduce:
- Create a database in firebase like
{
"jobs": {
"count": 0
}
}
- in Python, do
root.child('jobs/count').transaction(lambda x: x + 1 if x else 1)
Raised error: ValueError: Value argument must be a non-empty dictionary.
Relevant Code:
firebase-admin-python/firebase_admin/db.py
Lines 204 to 207 in 99c48ef
if not value or not isinstance(value, dict): | |
raise ValueError('Value argument must be a non-empty dictionary.') | |
if None in value.keys() or None in value.values(): | |
raise ValueError('Dictionary must not contain None keys or values.') |
These lines of code assume that the value passed in is a dictionary, which was not mentioned in the documentation (https://firebase.google.com/docs/database/admin/save-data#section-transactions) at all.
Metadata
Metadata
Assignees
Labels
No labels