You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2020/06/17 17:09:53 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #7469: ARROW-8832: [Python] Provide better error message when S3/HDFS is not enabled in installation

pitrou commented on a change in pull request #7469:
URL: https://github.com/apache/arrow/pull/7469#discussion_r441596426



##########
File path: python/pyarrow/fs.py
##########
@@ -35,14 +36,31 @@
 # For backward compatibility.
 FileStats = FileInfo
 
+_not_imported = []
+
 try:
     from pyarrow._hdfs import HadoopFileSystem  # noqa
 except ImportError:
-    pass
+    _not_imported.append("HadoopFileSystem")
 
 try:
     from pyarrow._s3fs import S3FileSystem, initialize_s3, finalize_s3  # noqa
 except ImportError:
-    pass
+    _not_imported.append("S3FileSystem")
 else:
     initialize_s3()
+
+
+if sys.version_info >= (3, 7):

Review comment:
       I don't think this is required. At worse `__getattr__` is a no-op :-)

##########
File path: python/pyarrow/fs.py
##########
@@ -35,14 +36,31 @@
 # For backward compatibility.
 FileStats = FileInfo
 
+_not_imported = []
+
 try:
     from pyarrow._hdfs import HadoopFileSystem  # noqa
 except ImportError:
-    pass
+    _not_imported.append("HadoopFileSystem")
 
 try:
     from pyarrow._s3fs import S3FileSystem, initialize_s3, finalize_s3  # noqa
 except ImportError:
-    pass
+    _not_imported.append("S3FileSystem")
 else:
     initialize_s3()
+
+
+if sys.version_info >= (3, 7):
+
+    def __getattr__(name):
+

Review comment:
       Spurious empty line?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org