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

aio.storage timeout type annotation #479

Open
djetelina opened this issue Jun 8, 2022 · 1 comment
Open

aio.storage timeout type annotation #479

djetelina opened this issue Jun 8, 2022 · 1 comment

Comments

@djetelina
Copy link

aio.storage has timeout defined as int in every type hint, but it falls down through aio.auth, where the type is set correctly (Timeout = Union[aiohttp.ClientTimeout, float]).

@TheKevJames
Copy link
Member

This is (somewhat) intentional: as we build both aiohttp-based and requests-based libraries, offering the aiohttp.ClientTimeout as an option outside of gcloud-aio-auth is not intended; rather, the specific http request handling library is meant to be as much of an implementation detail as possible.

That said, since this ticket got opened the build-rest script got a bit better able to handle this sort of polymorphism. I would be open to a PR which allowed users of the various non-auth gcloud-aio libraries to pass through the union of values you specified here, if we can further update that build script to convert it correctly (ie. to just Timeout = float) for gcloud-rest.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants