Skip to content

Commit 5c82dcf

Browse files
committed
undo bad commit, remove unneeded version checks
1 parent 9331a7e commit 5c82dcf

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

tests/unit/job/test_query_pandas.py

+8-6
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import json
1818

1919
import mock
20-
import pkg_resources
2120
import pytest
2221

2322

@@ -45,14 +44,19 @@
4544
except (ImportError, AttributeError): # pragma: NO COVER
4645
tqdm = None
4746

47+
try:
48+
import importlib.metadata as metadata
49+
except ImportError:
50+
import importlib_metadata as metadata
51+
4852
from ..helpers import make_connection
4953
from .helpers import _make_client
5054
from .helpers import _make_job_resource
5155

5256
if pandas is not None:
53-
PANDAS_INSTALLED_VERSION = pkg_resources.get_distribution("pandas").parsed_version
57+
PANDAS_INSTALLED_VERSION = metadata.version("pandas")
5458
else:
55-
PANDAS_INSTALLED_VERSION = pkg_resources.parse_version("0.0.0")
59+
PANDAS_INSTALLED_VERSION = "0.0.0"
5660

5761
pandas = pytest.importorskip("pandas")
5862

@@ -656,9 +660,7 @@ def test_to_dataframe_bqstorage_no_pyarrow_compression():
656660
)
657661

658662

659-
@pytest.mark.skipif(
660-
PANDAS_INSTALLED_VERSION >= pkg_resources.parse_version("2.0.0"), reason=""
661-
)
663+
@pytest.mark.skipif(PANDAS_INSTALLED_VERSION[0:2] not in ["0.", "1."], reason="")
662664
@pytest.mark.skipif(pyarrow is None, reason="Requires `pyarrow`")
663665
def test_to_dataframe_column_dtypes():
664666
from google.cloud.bigquery.job import QueryJob as target_class

0 commit comments

Comments
 (0)