sshiv012 commented on code in PR #8768:
URL: https://github.com/apache/texera/pull/8768#discussion_r4278755916


##########
amber/src/main/python/core/architecture/managers/executor_manager.py:
##########
@@ -119,15 +127,117 @@ def load_executor_definition(self, code: str) -> 
type(Operator):
         # gen_module_file_name guarantees module_name is unique across
         # the process, so import_module will always cleanly load source
         # from the tmp directory we just wrote — no re-import / reload dance.
-        executor_module = importlib.import_module(module_name)
+        try:
+            executor_module = importlib.import_module(module_name)
+        except SyntaxError:
+            # SyntaxError already carries the user's line number.
+            raise
+        except Exception as error:
+            raise self._with_user_code_hint(error, str(file_path)) from error
         self.operator_module_name = module_name
 
         executors = list(
             filter(self.is_concrete_operator, 
executor_module.__dict__.values())
         )
-        assert len(executors) == 1, "There should be one and only one Operator 
defined"
+        assert len(executors) == 1, (
+            "There should be one and only one Operator defined. "
+            + self._explain_operator_count(executors, executor_module)
+        )
         return executors[0]
 
+    # Each pytexera base class and the one method a subclass must implement.
+    _BASE_CLASS_METHODS = {

Review Comment:
   Added a test that compares the table with each pytexera class's 
__abstractmethods__, so it fails if they drift apart



-- 
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]

Reply via email to