|
@@ -21,6 +21,9 @@ from ..task_config import TaskConfig
|
|
|
|
|
|
|
|
|
class _TaskConfigChecker(_ConfigChecker):
|
|
|
+ # NOTE: # {task_type: ["required_key1"]}
|
|
|
+ _REQUIRED_PROPERTIES: Dict[str, List[str]] = {}
|
|
|
+
|
|
|
def __init__(self, config: _Config, collector: IssueCollector):
|
|
|
super().__init__(config, collector)
|
|
|
|
|
@@ -41,6 +44,7 @@ class _TaskConfigChecker(_ConfigChecker):
|
|
|
self._check_inputs(task_config_id, task_config)
|
|
|
self._check_outputs(task_config_id, task_config)
|
|
|
self._check_if_children_config_id_is_overlapping_with_properties(task_config_id, task_config)
|
|
|
+ self._check_required_properties(task_config_id, task_config)
|
|
|
return self._collector
|
|
|
|
|
|
def _check_if_children_config_id_is_overlapping_with_properties(self, task_config_id: str, task_config: TaskConfig):
|
|
@@ -88,3 +92,16 @@ class _TaskConfigChecker(_ConfigChecker):
|
|
|
f"{task_config._FUNCTION} field of TaskConfig `{task_config_id}` must be"
|
|
|
f" populated with Callable value.",
|
|
|
)
|
|
|
+
|
|
|
+ def _check_required_properties(self, task_config_id: str, task_config: TaskConfig):
|
|
|
+ task_config_properties = task_config.properties
|
|
|
+ for task_type, required_keys in self._REQUIRED_PROPERTIES.items():
|
|
|
+ if task_config_properties.get(task_type, False):
|
|
|
+ for required_key in required_keys:
|
|
|
+ if task_config_properties.get(required_key, None) is None:
|
|
|
+ self._error(
|
|
|
+ required_key,
|
|
|
+ None,
|
|
|
+ f"TaskConfig `{task_config_id}` is either missing the required "
|
|
|
+ f"property `{required_key}` or the value is set to None.",
|
|
|
+ )
|