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: us...@infra.apache.org