RelationalAI / rai-sdk-python

The RelationalAI Software Development Kit (SDK) for Python.
Apache License 2.0
17 stars 4 forks source link

Call query_async and poll for state in run_query.py #78

Closed salamehsameera closed 2 years ago

salamehsameera commented 2 years ago

The fast-path sync mode looks like:

Screen Shot 2022-04-01 at 12 29 20 PM

Where the async with polling mode looks like:

Screen Shot 2022-04-01 at 12 29 48 PM

This is based on https://github.com/RelationalAI/rai-sdk-python/pull/76. The base of this PR should be changed to main before merging.

The sync and async modes should look identical after closing out:

NHDaly commented 2 years ago

@salamehsameera for question 1.: I think you could get that piece by doing GET /transactions/{id}? (except for the results format version, currently, which makes me think that we should actually return that from the backend's createTransaction() response, and set it in Cosmos, so that you would get that there.

Does that sound reasonable?

salamehsameera commented 2 years ago

okay, this should be ready to review now

vilterp commented 2 years ago

This has been green since March; should we just merge it? πŸ˜›

vilterp commented 2 years ago

Looking again, we should probably move this to the new naming scheme:

This would be a breaking change, so we'd have to be sure to bump the version number accordingly before we release (major version bump I think?)

NHDaly commented 2 years ago

+1 to both fronts. πŸ‘ we can do those in two different steps if it's easier.

vilterp commented 2 years ago

This PR changes query to be async + poll.

Maybe we should change this PR to leave query unchanged, and add β€œquery + poll” as exec.

Can rename query to exec_v1 later.

NHDaly commented 2 years ago

Yes, that's a great plan. πŸ‘ πŸ‘ Do you want to make that change while sameera's out? πŸ™

vilterp commented 2 years ago

Yep, just pushed. Lmk how it looks

salamehsameera commented 2 years ago

Thanks Pete! I'm following up on this now