mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 09:05:47 +08:00
Use hdfs options by default in the test suite
This commit is contained in:
2 files changed
+6
-5
No files matched your search
@@ -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
|
||||
|
||||
@@ -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('/'))
|
||||
Reference in new issue
Block a user