|
17 | 17 | importjson |
18 | 18 |
|
19 | 19 | importmock |
20 | | -importpkg_resources |
21 | 20 | importpytest |
22 | 21 |
|
23 | 22 |
|
|
45 | 44 | except (ImportError,AttributeError):# pragma: NO COVER |
46 | 45 | tqdm=None |
47 | 46 |
|
| 47 | +try: |
| 48 | +importimportlib.metadataasmetadata |
| 49 | +exceptImportError: |
| 50 | +importimportlib_metadataasmetadata |
| 51 | + |
48 | 52 | from ..helpersimportmake_connection |
49 | 53 | from .helpersimport_make_client |
50 | 54 | from .helpersimport_make_job_resource |
51 | 55 |
|
52 | 56 | ifpandasisnotNone: |
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]notin ["0.","1."],reason="") |
662 | 664 | @pytest.mark.skipif(pyarrowisNone,reason="Requires `pyarrow`") |
663 | 665 | deftest_to_dataframe_column_dtypes(): |
664 | 666 | fromgoogle.cloud.bigquery.jobimportQueryJobastarget_class |
|