|
12 | 12 | # See the License for the specific language governing permissions and |
13 | 13 | # limitations under the License. |
14 | 14 |
|
15 | | -import concurrent.futures |
16 | 15 | import datetime |
17 | 16 | import decimal |
18 | 17 | from typing import Tuple |
19 | 18 |
|
20 | | -from google.api_core import exceptions |
21 | 19 | import pytest |
22 | | - |
| 20 | +from google.api_core import exceptions |
23 | 21 | from google.cloud import bigquery |
24 | 22 | from google.cloud.bigquery import enums |
25 | | -from google.cloud.bigquery.query import ArrayQueryParameter |
26 | | -from google.cloud.bigquery.query import ScalarQueryParameter |
27 | | -from google.cloud.bigquery.query import ScalarQueryParameterType |
28 | | -from google.cloud.bigquery.query import StructQueryParameter |
29 | | -from google.cloud.bigquery.query import StructQueryParameterType |
30 | | -from google.cloud.bigquery.query import RangeQueryParameter |
| 23 | +from google.cloud.bigquery.query import ( |
| 24 | + ArrayQueryParameter, |
| 25 | + RangeQueryParameter, |
| 26 | + ScalarQueryParameter, |
| 27 | + ScalarQueryParameterType, |
| 28 | + StructQueryParameter, |
| 29 | + StructQueryParameterType, |
| 30 | +) |
31 | 31 |
|
32 | 32 |
|
33 | 33 | @pytest.fixture(params=["INSERT", "QUERY"]) |
@@ -79,26 +79,6 @@ def test_query_many_columns( |
79 | 79 | assert row[f"col_{column}"] == rowval * column |
80 | 80 |
|
81 | 81 |
|
82 | | -def test_query_w_timeout(bigquery_client, query_api_method): |
83 | | - job_config = bigquery.QueryJobConfig() |
84 | | - job_config.use_query_cache = False |
85 | | - |
86 | | - query_job = bigquery_client.query( |
87 | | - "SELECT * FROM `bigquery-public-data.github_repos.commits`;", |
88 | | - location="US", |
89 | | - job_config=job_config, |
90 | | - api_method=query_api_method, |
91 | | - ) |
92 | | - |
93 | | - with pytest.raises(concurrent.futures.TimeoutError): |
94 | | - query_job.result(timeout=1) |
95 | | - |
96 | | - # Even though the query takes >1 second, the call to getQueryResults |
97 | | - # should succeed. |
98 | | - assert not query_job.done(timeout=1) |
99 | | - assert bigquery_client.cancel_job(query_job) is not None |
100 | | - |
101 | | - |
102 | 82 | def test_query_statistics(bigquery_client, query_api_method): |
103 | 83 | """ |
104 | 84 | A system test to exercise some of the extended query statistics. |
|
0 commit comments