Skip to content

Commit

Permalink
find_module deprecated in 3.12 replacing with import_module
Browse files Browse the repository at this point in the history
  • Loading branch information
LTDakin committed Sep 6, 2024
1 parent 831c195 commit 13182ae
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion datalab/datalab_session/data_operations/utils.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from pkgutil import walk_packages
import inspect
from importlib import import_module
from django.utils.module_loading import import_string
from datalab.datalab_session import data_operations

Expand All @@ -8,7 +9,7 @@ def available_operations():
operations = {}
base_operation = import_string('datalab.datalab_session.data_operations.data_operation.BaseDataOperation')
for (loader, module_name, _) in walk_packages(data_operations.__path__):
module = loader.find_module(module_name).load_module()
module = import_module(f'{data_operations.__name__}.{module_name}')
members = inspect.getmembers(module, inspect.isclass)
for member in members:
if member[0] != 'BaseDataOperation' and issubclass(member[1], base_operation):
Expand Down

0 comments on commit 13182ae

Please sign in to comment.