Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Async Client to Google-Cloud-Firestore #64

Closed
crwilcox opened this issue Jun 24, 2020 · 9 comments
Closed

Adding Async Client to Google-Cloud-Firestore #64

crwilcox opened this issue Jun 24, 2020 · 9 comments
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@crwilcox
Copy link
Contributor

No description provided.

@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Jun 24, 2020
@crwilcox crwilcox added this to the AsyncIO Client milestone Jun 24, 2020
@yoshi-automation yoshi-automation added the triage me I really want to be triaged. label Jun 25, 2020
@crwilcox crwilcox added type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. labels Jun 26, 2020
@yoshi-automation yoshi-automation removed the triage me I really want to be triaged. label Jun 26, 2020
@skgbanga
Copy link

skgbanga commented Nov 2, 2020

Hello,

I noticed that https://github.com/googleapis/python-firestore/releases/tag/v2.0.0-dev1 added support for async.
Do you think support is stable enough for production usage?

@crwilcox
Copy link
Contributor Author

crwilcox commented Nov 2, 2020

@skgbanga I would say so, though I have left it in dev to allow early usage and a fallback in case we find issues. I was planning to release v2.0.0-dev to v2.0.0 in its state this month. I currently anticipate no changes.

@NixBiks
Copy link

NixBiks commented Dec 21, 2020

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.

@samuelstroschein
Copy link

@crwilcox Is there a timeline when listening for realtime updates/streaming is supported with asyncio?

@crwilcox
Copy link
Contributor Author

I don't have a timeline to share at this time. This is on the backlog though.

@NixBiks
Copy link

NixBiks commented Dec 29, 2020

What about async support for the emulator?

And is there a workaround until it's fixed? I'm using the emulator for testing purposes

@crwilcox
Copy link
Contributor Author

crwilcox commented Jan 5, 2021

@mr-bjerre I am not sure I follow. I don't expect the emulator to require any changes. The Async changes are part of grpcio and the firestore client. The API surface hasn't been altered.

@NixBiks
Copy link

NixBiks commented Jan 5, 2021

@crwilcox not sure I understand what that means exactly? Have you seen my code example above? I'm getting exceptions when using the AsyncClient in combination with the firestore emulator. You don't?

@crwilcox
Copy link
Contributor Author

crwilcox commented Jan 6, 2021

@mr-bjerre I think my confusion is that you are raising a new issue, not about the addition of an async interface. I created a separate tracking issue.

As the only part of this issue that remains is watch clients, and that is spun off as #131 I am closing this issue.

@crwilcox crwilcox closed this as completed Jan 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
Development

No branches or pull requests

6 participants