Skip to content
This repository was archived by the owner on Mar 6, 2026. It is now read-only.

Commit 382fb70

Browse files
fix: fix checks support via typing
Signed-off-by: Radhika Agrawal <agrawalradhika@google.com>
1 parent b27687b commit 382fb70

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

google/auth/aio/transport/sessions.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
from contextlib import asynccontextmanager
1717
import functools
1818
import time
19+
import typing
1920
from typing import Mapping, Optional, TYPE_CHECKING, Union
2021

2122
from google.auth import _exponential_backoff, exceptions
@@ -260,11 +261,12 @@ async def request(
260261
)
261262
)
262263
if AIOHTTP_INSTALLED and hasattr(timeout, "total"):
263-
actual_timeout = float(timeout.total) # type: ignore
264+
# If it's a ClientTimeout, extract the total float
265+
actual_timeout = typing.cast(float, timeout.total)
264266
elif timeout is None:
265267
actual_timeout = 0.0
266268
else:
267-
actual_timeout = timeout
269+
actual_timeout = typing.cast(float, timeout)
268270
# Workaround issue in python 3.9 related to code coverage by adding `# pragma: no branch`
269271
# See https://github.com/googleapis/gapic-generator-python/pull/1174#issuecomment-1025132372
270272
async for _ in retries: # pragma: no branch

0 commit comments

Comments
 (0)