- Notifications
You must be signed in to change notification settings - Fork90
feat: implementOperationsRestAsyncTransport
to support long running operations#700
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
feat: implementOperationsRestAsyncTransport
to support long running operations#700
Uh oh!
There was an error while loading.Please reload this page.
Conversation
21bdadd
to1e108b4
Compare0ee82e0
to6e51532
Compareb6c1c6c
toeb78445
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
OperationsRestAsyncTransport
to support long running operationsbf76338
tof880c72
CompareUh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
from google.auth.aio import credentials as ga_credentials_async | ||
try: | ||
import aiohttp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Do we useaiohttp
in this file? A search reveals no references
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
We don't. We're only importing it to check that the library is installed with theasync_rest
extra.
Now, the actual problem is that if the libraries within the try block aren't installed, we silently skip the tests for async. Happy to discuss that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
So we try importingaiohttp
andtransport
because (1) we'll need them elsewhere for async REST, and (2) we want to set the flagGOOGLE_AUTH_AIO_INSTALLED
. We only look at the flag in this file to do the right thing.
I agree with doing the right thing. What makes me uneasy is the mysterious coupling with other modules "elsewhere" in (1). I think it would be more elegant to have a package-wide function or constant that takes care of querying the right things for async REST, probably by delegating to the files that use these imports.
However, this is a test file, so no need to block on this. But we should follow up.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
self, | ||
request: operations_pb2.ListOperationsRequest, | ||
*, | ||
timeout: Optional[float] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why don't we haveretry
as in the sync case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
retry
isn't passed down to the auth layer i.e. it's unused. We should file an issue to fix that for the case of sync and add this as a follow up feature to the async transport class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you file an issue to do those things?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Filed issues for each.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
from google.auth.aio import credentials as ga_credentials_async | ||
try: | ||
import aiohttp |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
So we try importingaiohttp
andtransport
because (1) we'll need them elsewhere for async REST, and (2) we want to set the flagGOOGLE_AUTH_AIO_INSTALLED
. We only look at the flag in this file to do the right thing.
I agree with doing the right thing. What makes me uneasy is the mysterious coupling with other modules "elsewhere" in (1). I think it would be more elegant to have a package-wide function or constant that takes care of querying the right things for async REST, probably by delegating to the files that use these imports.
However, this is a test file, so no need to block on this. But we should follow up.
Uh oh!
There was an error while loading.Please reload this page.
self, | ||
request: operations_pb2.ListOperationsRequest, | ||
*, | ||
timeout: Optional[float] = None, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Could you file an issue to do those things?
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
DEFAULT_CLIENT_INFO = gapic_v1.client_info.ClientInfo( | ||
gapic_version=BASE_DEFAULT_CLIENT_INFO.gapic_version, | ||
grpc_version=None, | ||
rest_version=auth_version, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
I also just filed#719 to rationalize this further, separately.
Uh oh!
There was an error while loading.Please reload this page.
3c7e43e
intoasync-rest-lro-support-in-coreUh oh!
There was an error while loading.Please reload this page.
* feat: implement `OperationsRestAsyncTransport` to support long running operations (#700)* feat: Add OperationsRestAsyncTransport to support long running operations* update TODO comment* update TODO comment* address feedback* address feedback* 🦉 Updates from OwlBot post-processorSeehttps://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md* fix mypy and lint issues* minor fix* add no cover* fix no cover tag* link coverage issue* silence coverage issue* fix statement name error* address PR feedback* address PR feedback* address PR comments---------Co-authored-by: ohmayr <omairnaveed@ymail.com>Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>* feat: implement async client for LROs (#707)* feat: implement `AbstractOperationsAsyncClient` to support long running operations* remove coverage guards* address presubmit failures* fix coverage for cancel operation* tests cleanup* fix incorrect tests* file bugs* add auth import* address PR comments* address PR comments* fix unit tests and address more comments* disable retry parameter* add retry parameter* address PR comments---------Co-authored-by: ohmayr <omairnaveed@ymail.com>Co-authored-by: ohmayr <omairn@google.com>* 🦉 Updates from OwlBot post-processorSeehttps://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md---------Co-authored-by: Anthonios Partheniou <partheniou@google.com>Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
Uh oh!
There was an error while loading.Please reload this page.
Towards b/362946071
This PR depends on#701