What happened:
The _check_fields() methods across multiple core modules use and instead of or in their validation checks. This causes invalid inputs (e.g., empty strings, wrong types like integers) to silently pass validation instead of raising ValueError.
Affected Files (10 instances across 4 files):
| File |
Field |
Line |
core/cmd/obj/benchmarkingjob.py |
self.name |
L54 |
core/cmd/obj/benchmarkingjob.py |
self.test_object |
L61 |
core/storymanager/rank/rank.py |
self.sort_by |
L61 |
core/storymanager/rank/rank.py |
self.visualization |
L66 |
core/storymanager/rank/rank.py |
self.selected_dataitem |
L72 |
core/storymanager/rank/rank.py |
self.save_mode |
L87 |
core/testcasecontroller/algorithm/algorithm.py |
self.name |
L133 |
core/testcasecontroller/algorithm/algorithm.py |
self.paradigm_type |
L136 |
core/testcasecontroller/algorithm/module/module.py |
self.type |
L61 |
core/testcasecontroller/algorithm/module/module.py |
self.name |
L69 |
What you expected to happen:
The validation should use or so the error is raised when either condition fails:
# Current (incorrect) — raises error only when BOTH conditions are true
if not self.name and not isinstance(self.name, str):
raise ValueError(...)
# Expected (correct) — raises error when EITHER condition is true
if not self.name or not isinstance(self.name, str):
raise ValueError(...)
With and:
self.name = "" → no error raised ❌ (empty string is falsy but is a str, so second condition is False)
self.name = 123 → no error raised ❌ (not 123 is False, short-circuits)
With or:
self.name = "" → ✅ error raised (falsy)
self.name = 123 → ✅ error raised (not a string)
self.name = None → ✅ error raised (falsy)
self.name = "valid" → ✅ passes
How to reproduce it (as minimally and precisely as possible):
from core.cmd.obj.benchmarkingjob import BenchmarkingJob
# This should raise ValueError but doesn't due to the bug
config = {
"name": 123, # integer instead of string — passes validation incorrectly
"workspace": "./workspace",
"test_object": {"type": "algorithms", "algorithms": []}
}
job = BenchmarkingJob(config)
Anything else we need to know?:
- The fix is a one-character change (
and → or) in each of the 10 locations listed above.
- Without this fix, the framework silently accepts invalid configurations, leading to hard-to-debug runtime errors downstream during test case construction or ranking instead of failing fast at config validation time.
- Environment: Python 3.8+, Linux (Fedora), main branch
What happened:
The
_check_fields()methods across multiple core modules useandinstead oforin their validation checks. This causes invalid inputs (e.g., empty strings, wrong types like integers) to silently pass validation instead of raisingValueError.Affected Files (10 instances across 4 files):
core/cmd/obj/benchmarkingjob.pyself.namecore/cmd/obj/benchmarkingjob.pyself.test_objectcore/storymanager/rank/rank.pyself.sort_bycore/storymanager/rank/rank.pyself.visualizationcore/storymanager/rank/rank.pyself.selected_dataitemcore/storymanager/rank/rank.pyself.save_modecore/testcasecontroller/algorithm/algorithm.pyself.namecore/testcasecontroller/algorithm/algorithm.pyself.paradigm_typecore/testcasecontroller/algorithm/module/module.pyself.typecore/testcasecontroller/algorithm/module/module.pyself.nameWhat you expected to happen:
The validation should use
orso the error is raised when either condition fails:With
and:self.name = ""→ no error raised ❌ (empty string is falsy but is astr, so second condition isFalse)self.name = 123→ no error raised ❌ (not 123isFalse, short-circuits)With
or:self.name = ""→ ✅ error raised (falsy)self.name = 123→ ✅ error raised (not a string)self.name = None→ ✅ error raised (falsy)self.name = "valid"→ ✅ passesHow to reproduce it (as minimally and precisely as possible):
Anything else we need to know?:
and→or) in each of the 10 locations listed above.