Summary
Follow-on from #3533 (StatusEnum enforcement in tests). The production files that the tests cover still assign raw status strings instead of using TaskStatus enum values.
Files to fix
orchestration/dag_executor.py:
- Line 357:
ctx.status = "failed"
- Line 364:
ctx.status = "failed"
- Line 382:
ctx.status = "failed"
- Line 386:
ctx.status = "completed" if ctx.error is None else "partially_completed"
orchestration/variable_resolver.py:
- Line 78:
status = "completed" if result["success"] else "failed"
Fix
Import TaskStatus from constants.status_enums and replace each raw string:
ctx.status = TaskStatus.FAILED.value
ctx.status = TaskStatus.COMPLETED.value if ctx.error is None else "partially_completed"
Note: "partially_completed" has no enum member yet — either add PARTIALLY_COMPLETED to TaskStatus or leave that one as a raw string with a comment.
Why
If a status value is renamed in the enum, production code using raw strings diverges silently. Tests (now using .value) would catch it, but the underlying production code would still be wrong.
Discovered during code review of PR #3537 / issue #3533.