Skip to content
This repository has been archived by the owner on Apr 1, 2023. It is now read-only.

Commit

Permalink
Remove driver param for hdfs.connect when using pyarrow 0.17 and above (
Browse files Browse the repository at this point in the history
  • Loading branch information
tgaddair authored and tkakantousis committed Sep 16, 2020
1 parent e3657b5 commit 70815eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion petastorm/hdfs/namenode.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,13 @@ def hdfs_connect_namenode(cls, url, driver='libhdfs3', user=None):
else:
hostname = six.text_type(url.hostname or 'default')
driver = six.text_type(driver)
return pyarrow.hdfs.connect(hostname, url.port or 8020, driver=driver, user=user)

kwargs = dict(user=user)
if LooseVersion(pyarrow.__version__) < LooseVersion('0.17.0'):
# Support for libhdfs3 was removed in v0.17.0, we include it here for backwards
# compatibility
kwargs['driver'] = driver
return pyarrow.hdfs.connect(hostname, url.port or 8020, **kwargs)

@classmethod
def connect_to_either_namenode(cls, list_of_namenodes, user=None):
Expand Down

0 comments on commit 70815eb

Please sign in to comment.