2626import pytest
2727
2828import pyarrow as pa
29- from pyarrow .pandas_compat import _pandas_api
3029from pyarrow .tests import util
3130from pyarrow .tests .parquet .common import _test_dataframe
3231from pyarrow .tests .parquet .test_dataset import (
3534)
3635from pyarrow .util import guid
3736
37+ try :
38+ from pandas .testing import assert_frame_equal
39+ except ImportError :
40+ pass
41+
42+
3843# ----------------------------------------------------------------------
3944# HDFS tests
4045
@@ -317,10 +322,10 @@ def test_read_multiple_parquet_files(self):
317322 expected = self ._write_multiple_hdfs_pq_files (tmpdir )
318323 result = self .hdfs .read_parquet (tmpdir )
319324
320- _pandas_api . assert_frame_equal (result . to_pandas ()
321- . sort_values (by = 'index' )
322- . reset_index ( drop = True ),
323- expected . to_pandas () )
325+ assert_frame_equal (
326+ result . to_pandas (). sort_values (by = 'index' ). reset_index ( drop = True ),
327+ expected . to_pandas ()
328+ )
324329
325330 @pytest .mark .pandas
326331 @pytest .mark .parquet
@@ -335,10 +340,10 @@ def test_read_multiple_parquet_files_with_uri(self):
335340 path = _get_hdfs_uri (tmpdir )
336341 result = pq .read_table (path )
337342
338- _pandas_api . assert_frame_equal (result . to_pandas ()
339- . sort_values (by = 'index' )
340- . reset_index ( drop = True ),
341- expected . to_pandas () )
343+ assert_frame_equal (
344+ result . to_pandas (). sort_values (by = 'index' ). reset_index ( drop = True ),
345+ expected . to_pandas ()
346+ )
342347
343348 @pytest .mark .pandas
344349 @pytest .mark .parquet
@@ -361,7 +366,7 @@ def test_read_write_parquet_files_with_uri(self):
361366 path , filesystem = self .hdfs , use_legacy_dataset = True
362367 ).to_pandas ()
363368
364- _pandas_api . assert_frame_equal (result , df )
369+ assert_frame_equal (result , df )
365370
366371 @pytest .mark .parquet
367372 @pytest .mark .pandas
@@ -420,8 +425,6 @@ def _get_hdfs_uri(path):
420425@pytest .mark .parquet
421426@pytest .mark .fastparquet
422427def test_fastparquet_read_with_hdfs ():
423- from pandas .testing import assert_frame_equal
424-
425428 check_libhdfs_present ()
426429 try :
427430 import snappy # noqa
0 commit comments