In places like this:
|
self.success_states = set(success_states) if success_states else {TaskInstanceState.SUCCESS.value} |
|
self.failure_states = set(failure_states) if failure_states else {TaskInstanceState.FAILED.value} |
in which we enumerate through success and failure states of task instances, this is currently being hardcoded. As @eladkal points out, if new states are added in the future, there is no protection.
is this logic right? If we fall back to the defaults it will consider skipped and removed as in progress state.
Also, there is no protection here against possible future addition of new state to task instance. For example we are discussing #12199
I suggest to add defensive test around adding more states so we'll know to modify code here or maybe we can consider adding more classes to categorized states similar to
|
class TerminalTIState(str, Enum): |
|
SUCCESS = "success" |
|
FAILED = "failed" |
|
SKIPPED = "skipped" |
|
REMOVED = "removed" |
Originally posted by @eladkal in #51719 (comment)
In places like this:
airflow/providers/amazon/src/airflow/providers/amazon/aws/triggers/mwaa.py
Lines 141 to 142 in c6cfc12
in which we enumerate through success and failure states of task instances, this is currently being hardcoded. As @eladkal points out, if new states are added in the future, there is no protection.