diff --git a/runtime/python-executor/datamate/core/dataset.py b/runtime/python-executor/datamate/core/dataset.py index 16d45cd..70b7ad0 100644 --- a/runtime/python-executor/datamate/core/dataset.py +++ b/runtime/python-executor/datamate/core/dataset.py @@ -136,6 +136,10 @@ class RayDataset(BasicDataset): if registry_content is None: from core.base_op import OPERATORS as RELATIVE_OPERATORS registry_content = RELATIVE_OPERATORS.modules.get(op_name) + + if registry_content is None: + raise ImportError(f"Operator '{op_name}' not found in any registry. Please check if the operator name is correct.") + if isinstance(registry_content, str): # registry_content是module的路径 submodule = importlib.import_module(registry_content) @@ -148,7 +152,7 @@ class RayDataset(BasicDataset): # registry_content是module本身 res = registry_content else: - res = None + raise ImportError(f"Invalid registry content for operator '{op_name}': expected str or BaseOp subclass, got {type(registry_content)}") return res def _run_single_op(self, operators_cls, init_kwargs, **kwargs):