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

fix: relax timeout expectations #1645

Merged
merged 4 commits into from
Aug 21, 2023
Merged

Conversation

shollyman
Copy link
Contributor

Changes to python-api-core can in certain cases cause timeout to be represented as a literal python base object type. This CL adjusts logic that selects from multiple timeout values to better handle this case, which previously assumed either a None or scalar value being present.

Fixes: #1612

Changes to python-api-core can in certain cases cause timeout to be
represented as a literal python base object type.  This CL adjusts
logic that selects from multiple timeout values to better handle this
case, which previously assumed either a None or scalar value being
present.

Fixes: googleapis#1612
@shollyman shollyman requested review from a team as code owners August 16, 2023 20:49
@product-auto-label product-auto-label bot added size: s Pull request size is small. api: bigquery Issues related to the googleapis/python-bigquery API. labels Aug 16, 2023
@product-auto-label product-auto-label bot added size: m Pull request size is medium. and removed size: s Pull request size is small. labels Aug 17, 2023
Copy link
Contributor

@chalmerlowe chalmerlowe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@chalmerlowe chalmerlowe merged commit 1760e94 into googleapis:main Aug 21, 2023
15 of 17 checks passed
@shollyman shollyman deleted the retry_types branch August 21, 2023 17:00
@idan3
Copy link

idan3 commented Jun 19, 2024

I got this error and after updating to google-cloud-bigquery==3.12.0 this error stopped but I get this instead:

 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.

Relevant libraries versions:

google-api-python-client==2.101.0
google-api-core==2.12.0
google-cloud-bigquery==3.12.0
requests==2.31.0
urllib3==1.26.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigquery Issues related to the googleapis/python-bigquery API. size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

GBQ query getting error of '>' not supported between instances of 'int' and 'object' randomly
3 participants