Skip to content

Transaction API does not match documentation #62

@andyfangdz

Description

@andyfangdz

[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:

  1. Create a database in firebase like
{
  "jobs": {
    "count": 0
  }
}
  1. 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:

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions