Skip to content

Commit

Permalink
Remove test_hdfs workaround
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Sep 14, 2022
1 parent baa0a25 commit a184425
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions python/pyarrow/tests/test_hdfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,13 @@
import pyarrow as pa
from pyarrow.pandas_compat import _pandas_api
from pyarrow.tests import util
from pyarrow.tests.parquet.common import _test_dataframe
from pyarrow.tests.parquet.test_dataset import (
_test_read_common_metadata_files, _test_write_to_dataset_with_partitions,
_test_write_to_dataset_no_partitions
)
from pyarrow.util import guid

try:
import pyarrow.parquet as pq
except ImportError:
pass
else:
from pyarrow.tests.parquet.common import _test_dataframe
from pyarrow.tests.parquet.test_dataset import (
_test_read_common_metadata_files,
_test_write_to_dataset_with_partitions,
_test_write_to_dataset_no_partitions
)

# ----------------------------------------------------------------------
# HDFS tests

Expand Down Expand Up @@ -290,6 +283,7 @@ def test_read_whole_file(self):
assert result == data

def _write_multiple_hdfs_pq_files(self, tmpdir):
import pyarrow.parquet as pq
nfiles = 10
size = 5
test_data = []
Expand Down Expand Up @@ -331,6 +325,8 @@ def test_read_multiple_parquet_files(self):
@pytest.mark.pandas
@pytest.mark.parquet
def test_read_multiple_parquet_files_with_uri(self):
import pyarrow.parquet as pq

tmpdir = pjoin(self.tmp_path, 'multi-parquet-uri-' + guid())

self.hdfs.mkdir(tmpdir)
Expand All @@ -347,6 +343,8 @@ def test_read_multiple_parquet_files_with_uri(self):
@pytest.mark.pandas
@pytest.mark.parquet
def test_read_write_parquet_files_with_uri(self):
import pyarrow.parquet as pq

tmpdir = pjoin(self.tmp_path, 'uri-parquet-' + guid())
self.hdfs.mkdir(tmpdir)
path = _get_hdfs_uri(pjoin(tmpdir, 'test.parquet'))
Expand Down Expand Up @@ -430,6 +428,7 @@ def test_fastparquet_read_with_hdfs():
except ImportError:
pytest.skip('fastparquet test requires snappy')

import pyarrow.parquet as pq
fastparquet = pytest.importorskip('fastparquet')

fs = hdfs_test_client()
Expand Down

0 comments on commit a184425

Please sign in to comment.