Skip to content
This repository was archived by the owner on Nov 12, 2025. It is now read-only.

Commit 30815d3

Browse files
authored
bug: updates checks for pandas 2.0 to skip certain tests (#647)
1 parent 9550ea6 commit 30815d3

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

tests/unit/test_reader_v1_arrow.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import pandas
2121
import pandas.testing
2222
import pytest
23+
import pkg_resources
2324

2425
import google.api_core.exceptions
2526
from google.cloud.bigquery_storage import types
@@ -28,6 +29,11 @@
2829

2930
pyarrow = pytest.importorskip("pyarrow")
3031

32+
if pandas is not None: # pragma: NO COVER
33+
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version
34+
else: # pragma: NO COVER
35+
PANDAS_INSTALLED_VERSION = pkg_resources.parse_version("0.0.0")
36+
3137

3238
# This dictionary is duplicated in bigquery/google/cloud/bigquery/_pandas_helpers.py
3339
# When modifying it be sure to update it there as well.
@@ -172,6 +178,9 @@ def test_to_arrow_w_scalars_arrow(class_under_test, mock_gapic_client):
172178
assert actual_table == expected_table
173179

174180

181+
@pytest.mark.skipif(
182+
PANDAS_INSTALLED_VERSION >= pkg_resources.parse_version("2.0.0"), reason=""
183+
)
175184
def test_to_dataframe_w_scalars_arrow(class_under_test, mock_gapic_client):
176185
arrow_schema = _bq_to_arrow_schema(SCALAR_COLUMNS)
177186
arrow_batches = _bq_to_arrow_batches(SCALAR_BLOCKS, arrow_schema)
@@ -239,6 +248,9 @@ def test_to_dataframe_w_dtypes_arrow(class_under_test, mock_gapic_client):
239248
)
240249

241250

251+
@pytest.mark.skipif(
252+
PANDAS_INSTALLED_VERSION >= pkg_resources.parse_version("2.0.0"), reason=""
253+
)
242254
def test_to_dataframe_empty_w_scalars_arrow(class_under_test, mock_gapic_client):
243255
arrow_schema = _bq_to_arrow_schema(SCALAR_COLUMNS)
244256
read_session = _generate_arrow_read_session(arrow_schema)

0 commit comments

Comments
 (0)