Skip to content

Commit

Permalink
Fix mypy after updates from types_requests (#1018)
Browse files Browse the repository at this point in the history
Summary:
Fix the mypy Error after `types_requests` is released to `2.28.11.13`

Pull Request resolved: #1018

Reviewed By: NivekT

Differential Revision: D43309767

Pulled By: ejguan

fbshipit-source-id: 1990ec809156c961ebf32d6f3b16b67071cc1303
  • Loading branch information
ejguan authored and facebook-github-bot committed Feb 15, 2023
1 parent 226d4dd commit a19c6f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions torchdata/datapipes/iter/load/online.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def _get_response_from_http(
) -> Tuple[str, StreamWrapper]:
with requests.Session() as session:
proxies = _get_proxies()
r = session.get(url, timeout=timeout, proxies=proxies, stream=True, **query_params) # type: ignore[arg-type]
r = session.get(url, timeout=timeout, proxies=proxies, stream=True, **query_params) # type: ignore[attr-defined]
r.raise_for_status()
return url, StreamWrapper(r.raw)

Expand Down Expand Up @@ -105,7 +105,7 @@ def _get_response_from_google_drive(
confirm_token = None

with requests.Session() as session:
response = session.get(url, timeout=timeout, stream=True, **query_params) # type: ignore[arg-type]
response = session.get(url, timeout=timeout, stream=True, **query_params) # type: ignore[attr-defined]
response.raise_for_status()

for k, v in response.cookies.items():
Expand All @@ -122,7 +122,7 @@ def _get_response_from_google_drive(
if confirm_token:
url = url + "&confirm=" + confirm_token

response = session.get(url, timeout=timeout, stream=True, **query_params) # type: ignore[arg-type]
response = session.get(url, timeout=timeout, stream=True, **query_params) # type: ignore[attr-defined]
response.raise_for_status()

if "content-disposition" not in response.headers:
Expand Down

0 comments on commit a19c6f8

Please sign in to comment.