villebro commented on code in PR #31622:
URL: https://github.com/apache/superset/pull/31622#discussion_r1902188120
##########
tests/integration_tests/base_tests.py:
##########
@@ -18,7 +18,7 @@
"""Unit tests for Superset"""
from datetime import datetime
-import imp
+import importlib.util
Review Comment:
nit: I'd almost prefer to only import `find_spec`:
```suggestion
from importlib.util import find_spec
```
##########
tests/integration_tests/base_tests.py:
##########
@@ -256,10 +256,10 @@ def get_table_by_id(table_id: int) -> SqlaTable:
return db.session.query(SqlaTable).filter_by(id=table_id).one()
@staticmethod
- def is_module_installed(module_name):
+ def is_module_installed(module_name: str) -> bool:
try:
- imp.find_module(module_name)
- return True
+ spec = importlib.util.find_spec(module_name)
Review Comment:
..and then
```suggestion
spec = find_spec(module_name)
```
--
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]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]