Abacn commented on code in PR #31219:
URL: https://github.com/apache/beam/pull/31219#discussion_r1595576227
##########
sdks/python/apache_beam/io/filesystems.py:
##########
@@ -35,28 +38,38 @@
# pylint: disable=wrong-import-position, unused-import
try:
from apache_beam.io.hadoopfilesystem import HadoopFileSystem
-except ImportError:
+except ModuleNotFoundError:
Review Comment:
It's No, not necessary and not working, based on my testing
I tested that if I installed beam without hdfs, and run
```
from apache_beam.io.hadoopfilesystem import HadoopFileSystem
```
I will get
"Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/yathu/dev/virtualenv/py38beam/lib/python3.8/site-packages/apache_beam/io/hadoopfilesystem.py",
line 29, in <module>
import hdfs
ModuleNotFoundError: No module named 'hdfs'
"
However, ModuleNotFoundError is a subclass of ImportError. The current logic
actually will make the warning get missed when trying to load HadoopFileSystem.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]