Use hdfs options by default in the test suite

This commit is contained in:
Krisztián Szűcs committed 2019-12-11 00:04:49 +01:00
1 parent ce5c77b1bd
commit 65796f8fc0
2 files changed
+6 -5

No files matched your search

+1 -2
View File
@@ -245,8 +245,7 @@ def hdfs_server():
host = os.environ.get('ARROW_HDFS_TEST_HOST', 'default')
port = int(os.environ.get('ARROW_HDFS_TEST_PORT', 0))
user = os.environ.get('ARROW_HDFS_TEST_USER', 'hdfs')
uri = "hdfs://{}:{}/?user={}".format(host, port, user)
return uri
return host, port, user
@pytest.mark.s3
+5 -3
View File
@@ -106,8 +106,8 @@ def hdfs(request, hdfs_server):
request.config.pyarrow.requires('hdfs')
from pyarrow.fs import HdfsOptions, HadoopFileSystem
uri, user = hdfs_server
options = HdfsOptions.from_uri(uri)
host, port, user = hdfs_server
options = HdfsOptions(endpoint=(host, port), user=user)
fs = HadoopFileSystem(options)
@@ -531,5 +531,7 @@ def test_hdfs_options(hdfs_server):
assert options.endpoint == ('localhost', 8080)
assert options.user == 'test'
fs = HadoopFileSystem('hdfs://localhost:8080/?user=test')
host, port, user = hdfs_server
uri = "hdfs://{}:{}/?user={}".format(host, port, user)
fs = HadoopFileSystem(uri)
assert fs.get_target_stats(Selector('/'))