From c277a832179c836a3ea993344566a141b49901dc Mon Sep 17 00:00:00 2001 From: Chalmer Date: Mon, 21 Aug 2023 13:45:07 +0000 Subject: [PATCH] bug: add type checking to prevent object issues --- google/cloud/bigquery/client.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/google/cloud/bigquery/client.py b/google/cloud/bigquery/client.py index 11cceea42..c7461a104 100644 --- a/google/cloud/bigquery/client.py +++ b/google/cloud/bigquery/client.py @@ -1894,6 +1894,14 @@ def _get_query_results( extra_params: Dict[str, Any] = {"maxResults": 0} + # Python_API_core, as part of a major rewrite of the deadline, timeout, + # and retry process sets the timeout value as a Python object(). + # Our system does not natively handle that and instead expects + # either none or a numeric value. If passed a Python object, convert to + # None. + if type(timeout) == object: # pragma: NO COVER + timeout = None + if timeout is not None: timeout = max(timeout, _MIN_GET_QUERY_RESULTS_TIMEOUT)