Skip to content

Async Client Commit raises TypeError: Unexpected type of call <class 'google.cloud.firestore_v1.types.firestore.CommitResponse'> under emulator #286

@crwilcox

Description

@crwilcox

branching from #64 (comment)

Thank you @mr-bjerre

Really appreciate the new support of AsyncClient !

One issue though. It doesn't work with the firestore emulator. The following script raises and exception

TypeError: Unexpected type of call <class 'google.cloud.firestore_v1.types.firestore.CommitResponse'>

Start the firestore emulator and run the script

import asyncio
from google.cloud.firestore import AsyncClient
import os


os.environ["FIRESTORE_EMULATOR_HOST"] = "localhost:8080"

client = AsyncClient()


async def save():
    return (
        await client.collection("test")
        .document("test")
        .set({"message": "Hello World!"})
    )


if __name__ == "__main__":
    loop = asyncio.get_event_loop()
    loop.run_until_complete(save())

The same issue goes for retrieving data.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api: firestoreIssues related to the googleapis/python-firestore API.externalThis issue is blocked on a bug with the actual product.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions