Skip to content

Commit ae59118

Browse files
committed
fix(auth): allow auto_descompress to be null
When auto_decompress is None, the default behaviour configured in the ClientSession will be used. For cases where users have provided a ClientSession object and configured that field, this will allow them to keep their configured behaviour.
1 parent 915c591 commit ae59118

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

auth/gcloud/aio/auth/session.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ async def get(
5252
self, url: str, headers: Mapping[str, str] | None,
5353
timeout: float, params: Mapping[str, int | str] | None,
5454
stream: bool,
55-
auto_decompress: bool,
55+
auto_decompress: bool | None,
5656
) -> Response:
5757
pass
5858

@@ -187,7 +187,7 @@ async def get( # type: ignore[override]
187187
timeout: Timeout = 10,
188188
params: Mapping[str, int | str] | None = None,
189189
stream: bool | None = None,
190-
auto_decompress: bool = True,
190+
auto_decompress: bool | None = True,
191191
) -> aiohttp.ClientResponse:
192192
if not isinstance(timeout, aiohttp.ClientTimeout):
193193
timeout = aiohttp.ClientTimeout(total=timeout)
@@ -326,9 +326,9 @@ async def get(
326326
timeout: float = 10,
327327
params: Mapping[str, int | str] | None = None,
328328
stream: bool = False,
329-
auto_decompress: bool = True,
329+
auto_decompress: bool | None = True,
330330
) -> Response:
331-
if not auto_decompress and not stream:
331+
if auto_decompress is False and not stream:
332332
warnings.warn(
333333
'the requests library always decompresses responses when '
334334
'outside of streaming mode; when auto_decompress is '

0 commit comments

Comments
 (0)