Skip to content
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.

GBQ query getting error of '>' not supported between instances of 'int' and 'object' randomly #1612

Description

@moveingsun

hi folks, we have a service that run hundreds of thousands GBQ query each day using python client. And recently I've notice the GBQ client fail randomly with error msg "'>' not supported between instances of 'int' and 'object' randomly", which seems to be an issue on client code. And the error just appear randonly. I've opened a support ticket in GCP console, but the conversation there get us nothing and i have to report the issue here, can anyone help me to understand what could cause this issue and how to get it fixed?

Environment details

  • OS type and version: Rocky Linux 8
  • Python version: 3.9.15
  • pip version: 22.2
  • google-cloud-bigquery version: 3.10.0 and above

Steps to reproduce

Unable to reproduce, happen randomly in our code.

Code example

try:
job=self.gbq_client.query(cmd, job_config=job_config, job_id=self.job_id, timeout=30)
self.session_id=job._properties["jobReference"].get("jobId", self.session_id)
self._result=jobjob.result()
failure=job.exception()
iffailure:
raiseQueryExecutionError(failure)
exceptBadRequestase:
raiseQueryExecutionError(str(e))
exceptExceptionase:
raisee

Stack trace

 File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/db_core/drivers/gbq_driver.py", line 317, in _execute
failure = job.exception()
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/api_core/future/polling.py", line 282, in exception
self._blocking_poll(timeout=timeout)
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py", line 1257, in _blocking_poll
super(QueryJob, self)._blocking_poll(timeout=timeout, **kwargs)
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/api_core/future/polling.py", line 137, in _blocking_poll
polling(self._done_or_raise)(retry=retry)
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/api_core/retry.py", line 349, in retry_wrapped_func
return retry_target(
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/api_core/retry.py", line 191, in retry_target
return target()
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py", line 1379, in _done_or_raise
self._reload_query_results(retry=retry, timeout=transport_timeout)
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/cloud/bigquery/job/query.py", line 1360, in _reload_query_results
self._query_results = self._client._get_query_results(
File "/pyenv/versions/worker-k8s/lib/python3.9/site-packages/google/cloud/bigquery/client.py", line 1895, in _get_query_results
timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)
TypeError: '>' not supported between instances of 'int' and 'object'

Making sure to follow these steps will guarantee the quickest resolution possible.

Thanks!

Metadata

Metadata

Assignees

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