Skip to content

Commit dd59d36

Browse files
authored
chore: address pandas 3 failure and remove inherently flaky system test (#17452)
Fixes b/523301714 🦕
1 parent 4d3447d commit dd59d36

2 files changed

Lines changed: 10 additions & 30 deletions

File tree

packages/google-cloud-bigquery/tests/system/test_pandas.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1098,7 +1098,7 @@ def test_list_rows_nullable_scalars_dtypes(bigquery_client, scalars_table, max_r
10981098

10991099
# pandas uses Python string and bytes objects.
11001100
assert df.dtypes["bytes_col"].name == "object"
1101-
assert df.dtypes["string_col"].name == "object"
1101+
assert df.dtypes["string_col"].name in ("str", "string", "object")
11021102

11031103

11041104
@pytest.mark.parametrize(

packages/google-cloud-bigquery/tests/system/test_query.py

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -12,22 +12,22 @@
1212
# See the License for the specific language governing permissions and
1313
# limitations under the License.
1414

15-
import concurrent.futures
1615
import datetime
1716
import decimal
1817
from typing import Tuple
1918

20-
from google.api_core import exceptions
2119
import pytest
22-
20+
from google.api_core import exceptions
2321
from google.cloud import bigquery
2422
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+
)
3131

3232

3333
@pytest.fixture(params=["INSERT", "QUERY"])
@@ -79,26 +79,6 @@ def test_query_many_columns(
7979
assert row[f"col_{column}"] == rowval * column
8080

8181

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-
10282
def test_query_statistics(bigquery_client, query_api_method):
10383
"""
10484
A system test to exercise some of the extended query statistics.

0 commit comments

Comments
 (0)