File tree 1 file changed +8
-6
lines changed
1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 17
17
import json
18
18
19
19
import mock
20
- import pkg_resources
21
20
import pytest
22
21
23
22
45
44
except (ImportError , AttributeError ): # pragma: NO COVER
46
45
tqdm = None
47
46
47
+ try :
48
+ import importlib .metadata as metadata
49
+ except ImportError :
50
+ import importlib_metadata as metadata
51
+
48
52
from ..helpers import make_connection
49
53
from .helpers import _make_client
50
54
from .helpers import _make_job_resource
51
55
52
56
if pandas is not None :
53
- PANDAS_INSTALLED_VERSION = pkg_resources . get_distribution ("pandas" ). parsed_version
57
+ PANDAS_INSTALLED_VERSION = metadata . version ("pandas" )
54
58
else :
55
- PANDAS_INSTALLED_VERSION = pkg_resources . parse_version ( "0.0.0" )
59
+ PANDAS_INSTALLED_VERSION = "0.0.0"
56
60
57
61
pandas = pytest .importorskip ("pandas" )
58
62
@@ -656,9 +660,7 @@ def test_to_dataframe_bqstorage_no_pyarrow_compression():
656
660
)
657
661
658
662
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 = "" )
662
664
@pytest .mark .skipif (pyarrow is None , reason = "Requires `pyarrow`" )
663
665
def test_to_dataframe_column_dtypes ():
664
666
from google .cloud .bigquery .job import QueryJob as target_class
You can’t perform that action at this time.
0 commit comments