File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed
Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 1717import json
1818
1919import mock
20- import pkg_resources
2120import pytest
2221
2322
4544except (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+
4852from ..helpers import make_connection
4953from .helpers import _make_client
5054from .helpers import _make_job_resource
5155
5256if pandas is not None :
53- PANDAS_INSTALLED_VERSION = pkg_resources . get_distribution ("pandas" ). parsed_version
57+ PANDAS_INSTALLED_VERSION = metadata . version ("pandas" )
5458else :
55- PANDAS_INSTALLED_VERSION = pkg_resources . parse_version ( "0.0.0" )
59+ PANDAS_INSTALLED_VERSION = "0.0.0"
5660
5761pandas = 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`" )
663665def test_to_dataframe_column_dtypes ():
664666 from google .cloud .bigquery .job import QueryJob as target_class
You can’t perform that action at this time.
0 commit comments