psf / requests

A simple, yet elegant, HTTP library.
https://requests.readthedocs.io/en/latest/
Apache License 2.0
52.2k stars 9.34k forks source link

ValueError: Timeout value connect was <object object at 0x7c6b5e484a80>, but it must be an int, float or None. #6744

Closed idan3 closed 5 months ago

idan3 commented 5 months ago

I use google-cloud-bigquery==3.12.0 which uses requests. requests and urllib3 are pined. requests==2.31.0 urllib3==1.26.18

I get this problem:

  File "/usr/local/lib/python3.10/site-packages/google/api_core/future/polling.py", line 282, in exception
    self._blocking_poll(timeout=timeout)
  File "/usr/local/lib/python3.10/site-packages/google/cloud/bigquery/job/query.py", line 1318, in _blocking_poll
    super(QueryJob, self)._blocking_poll(timeout=timeout, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/google/api_core/future/polling.py", line 137, in _blocking_poll
    polling(self._done_or_raise)(retry=retry)
  File "/usr/local/lib/python3.10/site-packages/google/api_core/retry.py", line 366, in retry_wrapped_func
    return retry_target(
  File "/usr/local/lib/python3.10/site-packages/google/api_core/retry.py", line 204, in retry_target
    return target()
  File "/usr/local/lib/python3.10/site-packages/google/cloud/bigquery/job/query.py", line 1460, in _done_or_raise
    self.reload(retry=retry, timeout=transport_timeout)
  File "/usr/local/lib/python3.10/site-packages/google/cloud/bigquery/job/base.py", line 781, in reload
    api_response = client._call_api(
  File "/usr/local/lib/python3.10/site-packages/google/cloud/bigquery/client.py", line 816, in _call_api
    return call()
  File "/usr/local/lib/python3.10/site-packages/google/cloud/_http/__init__.py", line 482, in api_request
    response = self._make_request(
  File "/usr/local/lib/python3.10/site-packages/google/cloud/_http/__init__.py", line 341, in _make_request
    return self._do_request(
  File "/usr/local/lib/python3.10/site-packages/google/cloud/_http/__init__.py", line 379, in _do_request
    return self.http.request(
  File "/usr/local/lib/python3.10/site-packages/google/auth/transport/requests.py", line 542, in request
    response = super(AuthorizedSession, self).request(
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/requests/adapters.py", line 483, in send
    timeout = TimeoutSauce(connect=timeout, read=timeout)
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/timeout.py", line 102, in __init__
    self._connect = self._validate_timeout(connect, "connect")
  File "/usr/local/lib/python3.10/site-packages/urllib3/util/timeout.py", line 147, in _validate_timeout
    raise ValueError(
ValueError: Timeout value connect was <object object at 0x7c6b5e484a80>, but it must be an int, float or None.
sigmavirus24 commented 5 months ago

This seems to be an issue with what the Google libraries are passing into requests and which we then pass on to urllib3. Raise a bug with Google.