GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — PollingFuture default timeout value `object()` incompatible with QueryJob typeguard in `_reload_query_results` · Issue #1459 · googleapis/python-bigquery

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

PollingFuture default timeout value object() incompatible with QueryJob typeguard in _reload_query_results #1459

Copy link
Copy link
Closed
#1541
Closed
PollingFuture default timeout value object() incompatible with QueryJob typeguard in _reload_query_results#1459
#1541
Copy link
Assignees
chalmerlowe
Labels
api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Description

@gbmarc1
gbmarc1
opened on Jan 10, 2023
Issue body actions

google.api_core.future.polling.PollingFuture default timeout value object() incompatible with google.cloud.bigquery.job.query.QueryJob typeguard in _reload_query_results.

A refactor in google-api-core introduced the global _DEFAULT_VALUE in the PollingFuture class ->
here.
This change is incompatible with google-cloud-bigquery typeguard here and becomes invalid and enters the if context which results in a error on this line.

TypeError: unsupported operand type(s) for -: 'object' and 'float'

The typeguard is based on the fact that the default value is None and not object().

As discussed here with @vam-google,

The default value cannot be None and the previous behavior of api-core was a bug. The gist of it is the need to distinguish between infinite timeout (None) and not specified timeout (_DEFAULT_TIMEOUT).

Stack trace

/usr/local/lib/python3.9/site-packages/feast/infra/offline_stores/bigquery.py:583: in block_until_done
--
  | if bq_job.exception():
  | /usr/local/lib/python3.9/site-packages/google/api_core/future/polling.py:282: in exception
  | self._blocking_poll(timeout=timeout)
  | /usr/local/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py:1245: in _blocking_poll
  | super(QueryJob, self)._blocking_poll(timeout=timeout, **kwargs)
  | /usr/local/lib/python3.9/site-packages/google/api_core/future/polling.py:137: in _blocking_poll
  | polling(self._done_or_raise)(retry=retry)
  | /usr/local/lib/python3.9/site-packages/google/api_core/retry.py:349: in retry_wrapped_func
  | return retry_target(
  | /usr/local/lib/python3.9/site-packages/google/api_core/retry.py:191: in retry_target
  | return target()
  | /usr/local/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py:1358: in _done_or_raise
  | self._reload_query_results(retry=retry, timeout=transport_timeout)
  | _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
  |  
  | self = QueryJob<project=..., location=US, id=...>
  | retry = None, timeout = <object object at 0x7fa46677c5c0>
  |  
  | def _reload_query_results(
  | self, retry: "retries.Retry" = DEFAULT_RETRY, timeout: float = None
  | ):
  | """Refresh the cached query results.
  |  
  | Args:
  | retry (Optional[google.api_core.retry.Retry]):
  | How to retry the call that retrieves query results.
  | timeout (Optional[float]):
  | The number of seconds to wait for the underlying HTTP transport
  | before using ``retry``.
  | """
  | if self._query_results and self._query_results.complete:
  | return
  |  
  | # Since the API to getQueryResults can hang up to the timeout value
  | # (default of 10 seconds), set the timeout parameter to ensure that
  | # the timeout from the futures API is respected. See:
  | # https://github.com/GoogleCloudPlatform/google-cloud-python/issues/4135
  | timeout_ms = None
  | if self._done_timeout is not None:
  | # Subtract a buffer for context switching, network latency, etc.
  | >           api_timeout = self._done_timeout - _TIMEOUT_BUFFER_SECS
  | E           TypeError: unsupported operand type(s) for -: 'object' and 'float'
  |  
  | /usr/local/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py:1329: TypeError

Thanks!

Activity

  1. product-auto-label
    added
    api: bigqueryIssues related to the googleapis/python-bigquery API.
    on Jan 10, 2023
  2. tswast
    added
    type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.
    on Jan 18, 2023
  3. brijk7
    assigned
    chalmerlowe
    on Apr 17, 2023
  4. brijk7
    added
    priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.
    on Apr 17, 2023
  5. chalmerlowe
    closed this as completedin #1541on Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @chalmerlowe
    chalmerlowe

Labels

api: bigqueryIssues related to the googleapis/python-bigquery API.priority: p1Important issue which blocks shipping the next release. Will be fixed prior to next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.